Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

executable file 32 lines (23 sloc) 0.627 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#!/bin/bash

# Run in virtualenv
test -r env/bin/activate && . env/bin/activate

PORT=$1

fail () {
    echo $@
    exit 1
}

test -r sikteeri/local_settings.py || fail "sikteeri/local_settings.py not found"
export PYTHONPATH=`pwd`

# Build translations
./build.sh

cd sikteeri

if [ -r sikteeri_test.sqlite ]; then
    ./manage.py syncdb || fail "Updating database failed"
else
    ./manage.py syncdb || fail "Creating database failed"
    ./manage.py loaddata membership_fees.json || fail "Loading test data failed"
fi

if [[ -z $PORT ]]; then
    PORT=12765
fi

./manage.py runserver $PORT || fail "Starting server failed"
Something went wrong with that request. Please try again.