network_inventory/development.sh
Andreas Zweili 3bb63bc44d replace the Django runserver command with gunicorn
I would like to test how this performs and if it works for development. Would
be nice because this way I can have a setup which is closer to what I run in
produciton than with Django runserver.
2020-06-28 16:48:23 +02:00

31 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
if [ -f ./.second_run ]; then
sleep 2
python manage.py collectstatic --noinput
python manage.py makemigrations
python manage.py migrate
else
python manage.py collectstatic --noinput
python manage.py makemigrations backups
python manage.py makemigrations computers
python manage.py makemigrations core
python manage.py makemigrations customers
python manage.py makemigrations devices
python manage.py makemigrations licenses
python manage.py makemigrations nets
python manage.py makemigrations softwares
python manage.py makemigrations users
python manage.py makemigrations
python manage.py migrate
python manage.py loaddata backups
python manage.py loaddata computers
python manage.py loaddata core
python manage.py loaddata devices
python manage.py loaddata nets
python manage.py loaddata softwares
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')"
python manage.py loaddata network_inventory.yaml
touch .second_run
fi
gunicorn network_inventory.wsgi:application --reload --bind 0.0.0.0:8000 --workers 3