diff options
author | 2020-09-28 23:00:41 +0530 | |
---|---|---|
committer | 2020-09-28 23:00:41 +0530 | |
commit | 68728d2340b39c8e889926686a102b5ed2c88ef4 (patch) | |
tree | ea53761a9290d05737ca9c1d90f4580baf90dbd4 /manage.py | |
parent | optimize bulk update endpoint by using Model.objects.bulk_update() method (diff) | |
parent | Add "Welcome to Python Discord" video to index (diff) |
Merge branch 'master' into user_endpoint
Diffstat (limited to 'manage.py')
-rwxr-xr-x | manage.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -112,6 +112,19 @@ class SiteManager: print("Database could not be found, exiting.") sys.exit(1) + @staticmethod + def set_dev_site_name() -> None: + """Set the development site domain in admin from default example.""" + # import Site model now after django setup + from django.contrib.sites.models import Site + query = Site.objects.filter(id=1) + site = query.get() + if site.domain == "example.com": + query.update( + domain="pythondiscord.local:8000", + name="pythondiscord.local:8000" + ) + def prepare_server(self) -> None: """Perform preparation tasks before running the server.""" django.setup() @@ -125,6 +138,7 @@ class SiteManager: call_command("collectstatic", interactive=False, clear=True, verbosity=self.verbosity) if self.debug: + self.set_dev_site_name() self.create_superuser() def run_server(self) -> None: |