aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2021-03-23 15:05:34 +0300
committerGravatar Hassan Abouelela <[email protected]>2021-03-23 15:05:34 +0300
commitfc53a53db1952d785ef3ca0eca8ec54dc5971db7 (patch)
tree0d133cff28e5043c356a43afc0ba883d731d0fec
parentMerge pull request #460 from python-discord/add-streamyard (diff)
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.
-rwxr-xr-xmanage.py4
1 files changed, 3 insertions, 1 deletions
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",