1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # For a monolithic project, just run the function from the project folder.
#
# For a reusable app, run the function from the folder containing the settings
# file, and pass the settings file as an argument.
# E.g. ``djsetup somecoolsite_settings.py``
djsetup()
{
if [ x"$1" != x ]; then
export PYTHONPATH=$PWD
export DJANGO_SETTINGS_MODULE=$(basename $1 .py)
else
cd ..
export PYTHONPATH=$PWD
export DJANGO_SETTINGS_MODULE=$(basename $OLDPWD).settings
cd $OLDPWD
fi
}
|
More like this
- Unfuddle-style post-commit emails - tied to a specific Django project. by jsandell 4 years, 9 months ago
- Command Line Script Launcher by dakrauth 4 years, 11 months ago
- SQL Log To Console Middleware by davepeck 3 years, 10 months ago
- More informative error mailings by kcarnold 5 years, 3 months ago
- Alternate method of autoloading Django models in ipython by drewr 5 years, 5 months ago
Comments