Welcome to django-autocomplete-light’s documentation!¶
This app fills all your ajax autocomplete needs:
- global navigation autocomplete like on facebook
- autocomplete widget for ModelChoiceField and ModelMultipleChoiceField
- GenericForeignKey fully supported
- django-generic-m2m support, yes that’s a generic M2M relation!
- CharField autocomplete support, comma separated values, useful for tags field,
- APIs powered autocomplete support, proposing results that are not (yet) in the database
- 0 hack required for admin integration, just use a form that uses the widget. It works exactly the same in the admin and in your pages.
- no jQuery-ui required, the autocomplete script is as simple as possible,
- optionnal autocomplete templating,
- 99% of the python logic is encapsulated in “autocomplete” classes, unlimited server side development possibilities
- add another also available outside the admin,
This is a simple alternative to django-ajax-selects.
- Python 2.7
- jQuery 1.7+
- Django 1.4+ (at least for autocomplete_light.forms helpers)
- django.contrib.staticfiles or you’re on your own
You could subscribe to the mailing list ask questions or just be informed of package updates.
- django-autocomplete-light demo
- test_project: basic features and examples
- test_remote_project: advanced features and examples
- Quick start
- Making a global navigation autocomplete
- Integration with forms
- Templating autocompletes
- CharField autocompletes
- Add another popup outside the admin
- GenericForeignKey support
- Proposing results from a remote API
- Dependencies between autocompletes
- Django 1.3 support workarounds
When things go wrong¶
There is a convenience view to visualize the registry, login as staff, and open the autocomplete url, for example: /autocomplete_light/.
- jquery is loaded,
autocomplete_light/static.htmlis included once, it should load
- your form uses autocomplete_light widgets,
- your channels are properly defined see
/autocomplete/if you included
If you don’t know how to debug, you should learn to use:
- Open the script tab, select a script, click on the left of the code to place a breakpoint
- Ipdb python debugger
- Install ipdb with pip, and place in your python code: import ipdb; ipdb.set_trace()
If you are able to do that, then you are a professional, enjoy autocomplete_light !!!
If you need help, open an issue on the github issues page.
Also, don’t hesitate to do pull requests !