I've set up a quick shell function in my .bashrc which sets the DJANGO_SETTINGS_MODULE environment variable for me, allowing tab completion.

The function is:

django-settings ()
    export DJANGO_SETTINGS_MODULE=$1.settings

pop that into your ~/.bashrc and for your next logins, you'll be able to do something like the following:

$ cd projects
$ dja<tab>s<tab> my<tab>

which will autocomplete to django-settings myproject, and sets DJANGO_SETTING_MODULE to myproject.settings.

I presume here that you operate out of a "projects" directory which is on your pythonpath.

Last modified 17 years ago Last modified on 12/27/05 09:42:52
Back to Top