diff options
author | 2019-09-30 14:14:16 +0200 | |
---|---|---|
committer | 2019-09-30 14:14:16 +0200 | |
commit | ba8f2d1722b8692f7fafd16ab45abbf721a02301 (patch) | |
tree | f78da574b2b02a01f91ade063b60664bc8e9ea81 /manage.py | |
parent | Merge 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.
Diffstat (limited to 'manage.py')
-rwxr-xr-x | manage.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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' |