From fc53a53db1952d785ef3ca0eca8ec54dc5971db7 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> Date: Tue, 23 Mar 2021 15:05:34 +0300 Subject: Removes Gunicorn Import In Debug mode Moves the gunicorn import below the start server command for debug mode to ensure it isn't imported if it isn't used. This solves issues with manage.py being unable to start on windows. --- manage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'manage.py') diff --git a/manage.py b/manage.py index fb5ee40c..71af23c4 100755 --- a/manage.py +++ b/manage.py @@ -7,7 +7,6 @@ import time from typing import List import django -import gunicorn.app.wsgiapp from django.contrib.auth import get_user_model from django.core.management import call_command, execute_from_command_line @@ -156,6 +155,9 @@ class SiteManager: call_command("runserver", "0.0.0.0:8000") return + # Import gunicorn only if we aren't in debug mode. + import gunicorn.app.wsgiapp + # Patch the arguments for gunicorn sys.argv = [ "gunicorn", -- cgit v1.2.3