improve runserver.sh
This commit is contained in:
parent
313219b6eb
commit
c0e1dcdde0
1 changed files with 23 additions and 4 deletions
27
runserver.sh
27
runserver.sh
|
@ -2,8 +2,27 @@
|
|||
|
||||
. env/bin/activate
|
||||
|
||||
if [ "$1" == 'prod' ]; then
|
||||
python manage.py runserver 0.0.0.0:8000 --settings ponytracker.local_settings
|
||||
else
|
||||
python manage.py runserver 0.0.0.0:8000
|
||||
cmd="python manage.py runserver"
|
||||
|
||||
function usage() {
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue