| 1 | {{{ |
| 2 | #!sh |
| 3 | #!/bin/bash |
| 4 | |
| 5 | DJANGO_PROJECT="$(basename `pwd`)" |
| 6 | #SERVER_ADDR="10.1.0.1" |
| 7 | #SERVER_PORT="8000" |
| 8 | |
| 9 | DJANGO_DB_NAME="${DJANGO_PROJECT}" |
| 10 | DJANGO_DB_USER='' |
| 11 | DJANGO_DB_PASS='' |
| 12 | |
| 13 | DJANGO_SECRET_UNIQUE_ID='YOUR_SECRET_UNIQUE_ID_HERE' |
| 14 | |
| 15 | |
| 16 | |
| 17 | PYTHONPATH="$(echo $PYTHONPATH):$(dirname `pwd`)" |
| 18 | |
| 19 | DJANGO_SETTINGS_MODULE="${DJANGO_PROJECT}.settings" |
| 20 | |
| 21 | if [ "$1" == "-S" ]; then |
| 22 | if [ -z "${SERVER_ADDR}" ]; then |
| 23 | SERVER_ADDR="localhost" |
| 24 | fi |
| 25 | if [ -z "${SERVER_PORT}" ]; then |
| 26 | SERVER_PORT="8000" |
| 27 | fi |
| 28 | django-admin.py runserver ${SERVER_ADDR}:${SERVER_PORT} \ |
| 29 | --settings="${DJANGO_PROJECT}.settings" |
| 30 | fi |
| 31 | }}} |