From 08bafd1443d2bad05df40a17d6c9e2e551801659 Mon Sep 17 00:00:00 2001 From: Anon23261 Date: Thu, 14 Nov 2024 22:17:42 -0700 Subject: [PATCH] fix: Update WSGI configuration to properly initialize Django --- pythonanywhere_wsgi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pythonanywhere_wsgi.py b/pythonanywhere_wsgi.py index 0d4ec85..fdc0e1f 100644 --- a/pythonanywhere_wsgi.py +++ b/pythonanywhere_wsgi.py @@ -11,7 +11,11 @@ sys.path.insert(0, project_home) # Set Django settings module -os.environ['DJANGO_SETTINGS_MODULE'] = 'ghostsec.settings.pythonanywhere' +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ghostsec.settings.pythonanywhere') + +# Set up Django +import django +django.setup() # Import Django WSGI handler from django.core.wsgi import get_wsgi_application