-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-prod.sh
24 lines (18 loc) · 863 Bytes
/
run-prod.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
# run-prod.sh
# This script should be ran before starting the server in prod.
# It does these things:
# 0. Migrate the Database
# 1. Create an admin superuser
# 2. Load any fixtures
# 3. Start the gunicorn production webserver
(cd /home/app; python manage.py migrate)
if [ -n "$DJANGO_SUPERUSER_USERNAME" ] && [ -n "$DJANGO_SUPERUSER_PASSWORD" ] ; then
(cd /home/app; python manage.py createsuperuser2 --noinput --email [email protected] --username $DJANGO_SUPERUSER_USERNAME --password $DJANGO_SUPERUSER_PASSWORD)
fi
# Seed the Database here with any Django Fixtures
#(cd /opt/app; python manage.py loaddata user_roles )
# Can't load content data until there exists an organization to attach content to
# python manage.py loaddata content
# Start gunicorn server
gunicorn agrawat_backend.wsgi:application -c ./gunicorn.conf.py