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 19 years ago Last modified on Dec 27, 2005, 3:42:52 AM
Note: See TracWiki for help on using the wiki.
Back to Top