From ba8f2d1722b8692f7fafd16ab45abbf721a02301 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Mon, 30 Sep 2019 14:14:16 +0200 Subject: Create superuser after doing migrations. Previously, the create_superuser() command was called before migrations had been completed on local setups, and this would cause the command to crash, saying that the table did not exist. --- manage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'manage.py') diff --git a/manage.py b/manage.py index 44435de5..a1057a17 100755 --- a/manage.py +++ b/manage.py @@ -119,13 +119,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' -- cgit v1.2.3