2024-11-24 12:25:57 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd docmanager_backend/
|
|
|
|
python manage.py graph_models -o ../documentation/erd/app_models.png
|
|
|
|
python manage.py spectacular --color --file schema.yml
|
|
|
|
python manage.py migrate
|
|
|
|
if [ ! -d "static" ]; then
|
|
|
|
echo "Generating static files"
|
|
|
|
python manage.py collectstatic --noinput
|
|
|
|
fi
|
2024-11-27 00:32:53 +08:00
|
|
|
tmux new-session -d -s "API File Watcher" "cd /app/docmanager_backend && python manage.py start_watcher"
|
2024-11-27 00:49:20 +08:00
|
|
|
if [ "$DEBUG" = 'True' ]; then
|
2024-11-24 12:25:57 +08:00
|
|
|
python manage.py runserver "0.0.0.0:8000"
|
|
|
|
else
|
|
|
|
gunicorn --workers 8 --bind 0.0.0.0:8000 config.wsgi:application
|
|
|
|
fi
|