-
Notifications
You must be signed in to change notification settings - Fork 27
/
run-devel
executable file
·35 lines (28 loc) · 1.04 KB
/
run-devel
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
33
34
#!/bin/bash
set -xe
cd /srv/softwarecollections
cp softwarecollections/localsettings{-development,}.py
test -e data/db.sqlite3 && dbexists=0 || dbexists=1
./manage.py migrate --noinput
if [ $dbexists -ne 0 ]; then
echo "from django.contrib.auth.models import User
User.objects.filter(email='[email protected]').delete()
User.objects.create_superuser('[email protected]', 'test', 'test')" | python3 manage.py shell
# echo -e "test\[email protected]\ntest\ntest\n" | ./manage.py createsuperuser
./manage.py makesuperuser [email protected]
fi
chmod a+w data/db.sqlite3
# start memcached on background
echo "Starting memcached ..."
memcached &
./manage.py loaddata example-data.yaml
# show nice IP that can be used in browser with some delay
# and in separate process, because python runs in frontend
(
set +x
sleep 2
echo "========================================================"
echo "App started at http://$(hostname --ip-address):8000"
echo "========================================================"
) &
./manage.py runserver 0.0.0.0:8000