aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2019-09-30 14:14:16 +0200
committerGravatar Leon Sandøy <[email protected]>2019-09-30 14:14:16 +0200
commitba8f2d1722b8692f7fafd16ab45abbf721a02301 (patch)
treef78da574b2b02a01f91ade063b60664bc8e9ea81
parentMerge pull request #261 from python-discord/decoupling-warnings-and-notes (diff)
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.
-rwxr-xr-xmanage.py4
1 files changed, 3 insertions, 1 deletions
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'