install bin/manage.py wrapper script for django, remove console process type

This commit is contained in:
Noah Zoschke
2011-08-27 14:08:16 -07:00
parent c2f4f929f7
commit e7495df18f
2 changed files with 12 additions and 4 deletions
+11 -2
View File
@@ -33,14 +33,15 @@ done
echo "-----> Preparing virtualenv version $(virtualenv --version)"
virtualenv --no-site-packages . | sed -u 's/^/ /'
echo "-----> Byte-compiling code"
find . -name "*.py" | xargs bin/python -m py_compile
#echo "-----> Byte-compiling code"
find . -name "*.py" | grep -v bin/manage.py | xargs bin/python -m py_compile
# if Django, inject psycopg and append settings
if [ "$NAME" = "Python/Django" ]; then
echo "-----> Django settings injection"
SETTINGS_FILE=$(ls **/settings.py | head -1)
PROJECT=$(dirname $SETTINGS_FILE)
echo " Injecting code into $SETTINGS_FILE to read from DATABASE_URL"
cat >>$SETTINGS_FILE <<EOF
@@ -58,6 +59,14 @@ if os.environ.has_key('DATABASE_URL'):
'PORT': url.port,
}
EOF
echo "-----> Django script installation"
cat >bin/manage.py <<EOF
#!/bin/bash
BIN_DIR=\$(cd \$(dirname \$0); pwd)
python \$BIN_DIR/../$PROJECT/manage.py \$*
EOF
chmod +x bin/manage.py
fi
echo "-----> Installing dependencies using pip version $(bin/pip --version | awk '{print $2}')"
+1 -2
View File
@@ -26,5 +26,4 @@ addons:
default_process_types:
web: bin/python $PROJECT/manage.py runserver 0.0.0.0:\$PORT --noreload
console: bin/python $PROJECT/manage.py shell
EOF
EOF