Created
March 6, 2011 10:46
-
-
Save abhiomkar/857197 to your computer and use it in GitHub Desktop.
setdsm sets the DJANGO_SETTINGS_MODULE to the settings.py in the current directory and add the current directory and it’s parent to PYTHONPATH. Source: http://www.juiceanalytics.com/writing/django_settings_module/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setdsm() { | |
| # add the current directory and the parent directory to PYTHONPATH | |
| # sets DJANGO_SETTINGS_MODULE | |
| export PYTHONPATH=$PYTHONPATH:$PWD/.. | |
| export PYTHONPATH=$PYTHONPATH:$PWD | |
| if [ -z "$1" ]; then | |
| x=${PWD/\/[^\/]*\/} | |
| export DJANGO_SETTINGS_MODULE=$x.settings | |
| else | |
| export DJANGO_SETTINGS_MODULE=$1 | |
| fi | |
| echo "DJANGO_SETTINGS_MODULE set to $DJANGO_SETTINGS_MODULE" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment