Use django-admin.py instead of manage.py

 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

  1. Unfuddle-style post-commit emails - tied to a specific Django project. by jsandell 4 years, 8 months ago
  2. Command Line Script Launcher by dakrauth 4 years, 10 months ago
  3. SQL Log To Console Middleware by davepeck 3 years, 9 months ago
  4. More informative error mailings by kcarnold 5 years, 2 months ago
  5. Alternate method of autoloading Django models in ipython by drewr 5 years, 4 months ago

Comments

(Forgotten your password?)