improve runserver.sh

This commit is contained in:
Élie Bouttier 2014-08-22 18:49:23 -07:00
parent 313219b6eb
commit c0e1dcdde0

View file

@ -2,8 +2,27 @@
. env/bin/activate . env/bin/activate
if [ "$1" == 'prod' ]; then cmd="python manage.py runserver"
python manage.py runserver 0.0.0.0:8000 --settings ponytracker.local_settings
else function usage() {
python manage.py runserver 0.0.0.0:8000 echo "Usage: $0 [default|local]"
exit 1
}
if [[ "$#" -gt 2 ]]; then
usage
fi
conf="$1"
if [ "$conf" == "" ]; then
conf="default"
fi
if [ "$conf" == 'default' ]; then
$cmd
elif [ "$conf" == 'local' ]; then
$cmd --settings ponytracker.local_settings
else
usage
fi fi