I've just installed Django-Autocomplete-Light and followed the guide on their site. I've setup the autocomplete-view and it works as intended (returning a JASON of autocomplete options). I can't seem to get the widgets to show up, though. in and out of the admin panel.
Everything compiles without errors but instead the widget I get an empty drop down selection box.
Image of empty selection box in admin panel
This is my settings.py:
INSTALLED_APPS = [
'dal',
'dal_select2',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'selectable',
'videos.apps.VideosConfig',
]
This is views.py:
class ActorAutocomplete(autocomplete.Select2QuerySetView):
def get_queryset(self):
# Don't forget to filter out results depending on the visitor !
qs = Actor.objects.all()
if self.q:
qs = qs.filter(name__istartswith=self.q)
return qs
urls.py:
url(r'^actor-autocomplete/$', views.ActorAutocomplete.as_view(), name='actor-autocomplete'),
forms.py:
class ActorForm(forms.ModelForm):
class Meta:
model = Actor
fields = ('name',)
widgets = {
'name': autocomplete.Select(url='videos/actor-autocomplete')
}
It feels like I'm missing something simple, but I don't know what it is. Perhaps it can't access the static files, but adding 'dal' to installed_app in settings.py should have solved that according to the documentation. I'll appreciate any help!
I forgot to mention that Actor.name is of type CharField. Perhaps I'm not using the correct widget, but I haven't found one that is specific for CharField.
As I have the same problem, here is the content of my console in Firefox:
Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page.
It seems that jQuery is needed but not found, but I can't find a way to link it properly.
It is also running perfectly in Chromium. I don't have any other browser to test.