| | 1 | I've set up a quick shell function in my .bashrc which sets the DJANGO_SETTINGS_MODULE environment variable for me, allowing tab completion. |
| | 2 | |
| | 3 | The function is: |
| | 4 | |
| | 5 | |
| | 6 | {{{ |
| | 7 | django-settings () |
| | 8 | { |
| | 9 | export DJANGO_SETTINGS_MODULE=$1.settings |
| | 10 | } |
| | 11 | }}} |
| | 12 | |
| | 13 | |
| | 14 | pop that into your ~/.bashrc and for your next logins, you'll be able to do something like the following: |
| | 15 | |
| | 16 | |
| | 17 | |
| | 18 | {{{ |
| | 19 | $ cd projects |
| | 20 | $ dja<tab>s<tab> my<tab> |
| | 21 | }}} |
| | 22 | |
| | 23 | |
| | 24 | which will autocomplete to {{{django-settings myproject}}}, and sets DJANGO_SETTING_MODULE to myproject.settings. |
| | 25 | |
| | 26 | I presume here that you operate out of a "projects" directory which is on your pythonpath. |