From 874a3844776d6110d882d50c9cc71c3a897f209e Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Mon, 21 Oct 2024 19:59:01 -0400 Subject: [PATCH] Migrate Django server to guicorn --- backend/entrypoint.sh | 4 ++-- backend/server/main/wsgi.py | 2 +- backend/server/requirements.txt | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index cbb40db..9308943 100644 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -36,5 +36,5 @@ fi # Sync the countries and world travel regions python manage.py download-countries -# Start Django server -python manage.py runserver 0.0.0.0:8000 +# Start gunicorn +gunicorn main.wsgi:application --bind 0.0.0.0:8000 \ No newline at end of file diff --git a/backend/server/main/wsgi.py b/backend/server/main/wsgi.py index 71ca83e..0a4407a 100644 --- a/backend/server/main/wsgi.py +++ b/backend/server/main/wsgi.py @@ -11,7 +11,7 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") application = get_wsgi_application() # add this vercel variable diff --git a/backend/server/requirements.txt b/backend/server/requirements.txt index 225506d..0458487 100644 --- a/backend/server/requirements.txt +++ b/backend/server/requirements.txt @@ -12,4 +12,5 @@ Pillow whitenoise django-resized django-geojson -setuptools \ No newline at end of file +setuptools +gunicorn==23.0.0 \ No newline at end of file