django-autocomplete-light demo

The test_project lives in the test_project subdirectory of django-autocomplete-light’s repository.


We’re going to use virtualenv, so that we don’t pollute your system when installing dependencies. If you don’t already have virtualenv, you can install it either via your package manager, either via python’s package manager with something like:

sudo easy_install virtualenv

Install last release:

rm -rf django-autocomplete-light autocomplete_light_env/

virtualenv autocomplete_light_env
source autocomplete_light_env/bin/activate
git clone
cd django-autocomplete-light/test_project
pip install -r requirements.txt
./ runserver

Install development versions, if you want to contribute hehehe:


rm -rf autocomplete_light_env/

virtualenv autocomplete_light_env
source autocomplete_light_env/bin/activate
pip install -e git+git://$CITIES_LIGHT_VERSION#egg=cities_light
pip install -e git+git://$AUTOCOMPLETE_LIGHT_VERSION#egg=autocomplete_light
cd autocomplete_light_env/src/autocomplete-light/test_project
pip install -r requirements.txt
./ runserver

Login with user “test” and password “test”.

If you want to redo the database, but make sure you read README first:

rm db.sqlite
./ syncdb
./ cities_light

Try basic features

Once you have the test_project server running (see INSTALL if you don’t), open the first contact.

You will see two addresses:

  • one at Paris, France
  • one at Paris, United States

The reason for that is that there are several cities in the world with the name “Paris”. This is the reason why the double autocomplete widget is interresting: it filters the cities based on the selected country.

Note that only cities from France, USA and Belgium are in the demo database.

Note that you can test autocompletes for generic foreign keys in this project too.

Try advanced features

Assuming you installed the test_project, all you need in addition is to install requirements for this project:

cd autocomplete_light_env/src/autocomplete-light/test_api_project
pip install -r requirements.txt

Then, refer to README.rst in this folder.

This project demonstrates how the autocomplete can suggest results from a remote API - and thus which don’t have a pk in the local database.

In one console:

cd test_project
./ runserver

In another:

cd test_api_project
./ runserver

In http://localhost:8001/admin, you should be able to test:

  • compatibility with django-admintools-bootstrap
  • generic fk autocomplete
  • generic m2m autocomplete
  • remote api autocomplete (cities/countries are suggested and imported from test_project)
  • autocompletes in inlines, dual widget, etc, etc ...

If you’re not going to use localhost:8000 for test_project, then you should update source urls in test_api_project/test_api_project/

Now, note that there are no or few countries in test_api_project database.

Again, test_project’s database only includes countries France, Belgium and America so there’s no need to try the other one unless you know what you’re doing.

Also note that, city and country autocomplete work the same. The reason for that is that test_api_project uses City and Country remote channel to add results to the autocomplete that are not in the local database.

Project Versions

Table Of Contents

Previous topic

Welcome to django-autocomplete-light’s documentation!

Next topic

Quick start

This Page