run django with gunicorn
This commit is contained in:
parent
32df8c464e
commit
521aaef946
|
@ -5,7 +5,7 @@ ALLOWED_HOSTS = [
|
||||||
]
|
]
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = 'kzx(i9^@*g^cgp(_3052%*1d%zyu^2z_@pgso5!_q@jb-j%4m='
|
SECRET_KEY = os.getenv('SECRET_KEY')
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
cd network_inventory
|
||||||
|
if [ -f ./.second_run ]; then
|
||||||
|
python manage.py makemigrations
|
||||||
|
python manage.py migrate
|
||||||
|
else
|
||||||
|
python manage.py makemigrations
|
||||||
|
python manage.py migrate
|
||||||
|
python manage.py loaddata inventory
|
||||||
|
python manage.py shell -c "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@example.com', 'password')"
|
||||||
|
touch .second_run
|
||||||
|
fi
|
||||||
|
|
||||||
|
gunicorn network_inventory.wsgi:application --bind 0.0.0.0:8000 --workers 3
|
|
@ -1,3 +1,4 @@
|
||||||
-r base.txt
|
-r base.txt
|
||||||
|
|
||||||
psycopg2
|
psycopg2
|
||||||
|
gunicorn
|
||||||
|
|
Loading…
Reference in New Issue