diff options
Diffstat (limited to 'manage.py')
-rwxr-xr-x | manage.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -7,7 +7,6 @@ import time from typing import List import django -import pyuwsgi from django.contrib.auth import get_user_model from django.core.management import call_command, execute_from_command_line @@ -119,13 +118,15 @@ class SiteManager: if self.debug: self.wait_for_postgres() - self.create_superuser() print("Applying migrations.") call_command("migrate", verbosity=self.verbosity) print("Collecting static files.") call_command("collectstatic", interactive=False, clear=True, verbosity=self.verbosity) + if self.debug: + self.create_superuser() + def run_server(self) -> None: """Prepare and run the web server.""" in_reloader = os.environ.get('RUN_MAIN') == 'true' @@ -141,6 +142,8 @@ class SiteManager: call_command("runserver", "0.0.0.0:8000") return + import pyuwsgi + # Run uwsgi for production server pyuwsgi.run(["--ini", "docker/uwsgi.ini"]) |