title: How to use django-autocomplete-light
body: <p>How do I use django_autcomplete_light to add autocomplete to one field in a form.  I have a form which is based off of a model, and I want to add autocomplete to the firstname field.</p>
  
  <p>I have done the following so far:</p>
  
  <p>Install django_autocomplete_light</p>
  
  <p>Changed the INSTALLED_APPS:</p>
  
  <pre><code>INSTALLED_APPS = (
    'autocomplete_light',
    'django.contrib.admin',
     ...
  </code></pre>
  
  <p>Added it to urls.py, here is my urls.py:</p>
  
  <p>from django.conf.urls import include, url
  from django.contrib import admin</p>
  
  <pre><code>urlpatterns = [
      url(r"^admin/", include(admin.site.urls)),
      url(r"^app/", include("app.urls")),
      url(r"^autocomplete/", include("autocomplete_light.urls")),
      url(r"^.*$", include("app.urls")),
  ]
  </code></pre>
  
  <p>Created a file called autocomplete_light_registry.py and added the following:</p>
  
  <pre><code>import autocomplete_light as al
  from .models import *
  
  al.register(Person,
      search_fields = ["^firstname"],
      attrs={
          "placeholder":"First name",
          "data-autocomplete-minimum-characters":1,
      },
      widget_attrs={
          "data-widget-maximum-values":4,
          "class":"modern-style",
      },
  )
  </code></pre>
  
  <p>changed my PersonForm from:</p>
  
  <pre><code>class PersonForm(forms.ModelForm)
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>class PersonForm(autocomplete_light.ModelForm)
  
      class Meta:
          model = Person
          autocomplete_fields = ("firstname")
  </code></pre>
  
  <p>I also added the following line to the html page for the form:</p>
  
  <pre><code>{% include 'autocomplete_light/static.html' %}
  </code></pre>
  
  <p>And I imported all the necessary jquery files</p>
  
  <p>But the autocomplete does not appear.  I don't get any errors.  I followed the documentations tutorial.</p>
  
  <p>I am using <code>python manage.py runserver</code> to run the application.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I changed the urlpatterns to (made the django-autocomplete-light url first):</p>
  
  <pre><code>urlpatterns = [
      url(r"^autocomplete/", include("autocomplete_light.urls")),
      url(r"^admin/", include(admin.site.urls)),
      url(r"^app/", include("app.urls")),
      url(r"^.*$", include("app.urls")),
  ]
  </code></pre>
  
  <p>This did not solve the problem though.</p>