Skip to content

Commit

Permalink
django: start script: make migrations for sensordata
Browse files Browse the repository at this point in the history
Load initial data when creating a new database.

Do not update static files at each start in the django startup script.

Signed-off-by: Jonas Remmert <jremmert@gmx.net>
  • Loading branch information
jonas-rem authored and Kappuccino111 committed May 27, 2024
1 parent df75c77 commit c83806f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/django/django_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ logfile="logs/django_$(date +%Y-%m-%d_%H-%M-%S).log"
touch "$logfile"

# Start Django Server
python manage.py collectstatic --noinput 2>&1 | tee -a "$logfile"
python manage.py makemigrations 2>&1 | tee -a "$logfile"
# python manage.py collectstatic --noinput 2>&1 | tee -a "$logfile"
echo "Running makemigrations for sensordata..."
python manage.py makemigrations sensordata 2>&1 | tee -a "$logfile"
echo "Running migrate..."
python manage.py migrate 2>&1 | tee -a $logfile
echo "Loading initial data..."
python manage.py loaddata db_initial_data.json 2>&1 | tee -a $logfile
echo "Starting the server..."
python manage.py runserver 0.0.0.0:8000 2>&1 | tee -a "$logfile"

0 comments on commit c83806f

Please sign in to comment.