2π
β
(i canβt write comments soβ¦) To clarify situation:
- provide Django version you are using, (as version of taggit-autosuggest, specified above, wont work with django 1.6+ (1.8 in my case))
- check that server side of app is working β go to http://yoursite/taggit_autosuggest/list/ β it must provide JSON list of your tags (if any) or empty list
- check that clien side is present
- check that http://yoursite/static/jquery-autosuggest/js/jquery.autoSuggest.js available
- check that http://yoursite/static/jquery-autosuggest/css/autoSuggest.css available
If any of files is missing, you should get it from repository.
(We assume that /static is STATIC_URL in your config)
Upd: Start to work when connecting Form with Model (using ModelForm ) :
from django.forms import ModelForm
class OokForm(ModelForm):
class Meta:
model = Ook
fields = ['name', 'tags']
in views.py:
def OokView (request):
form = OokForm()
c = {'form': form}
return render(request,'ook_form.html', c)
in ook_form.html:
<html>
<head>
<!-- Be sure that there is no JS errors during loading -->
<script src="//code.jquery.com/jquery-1.10.1.min.js"></script>
<link href="/static/jquery-autosuggest/css/autoSuggest-grappelli.css" type="text/css" media="all" rel="stylesheet" />
<script type="text/javascript" src="/static/jquery-autosuggest/js/jquery.autoSuggest.minified.js">
</script>
</head>
<form action="/your-name/" method="post">
{% csrf_token %}
{{ form }}
<input type="submit" value="Submit" />
</form>
</body>
π€1844144
Source:stackexchange.com