Merge pull request 'fix: update existing default site in seed command' (#8) from fix/seed-default-site into main
Reviewed-on: #8
This commit was merged in pull request #8.
This commit is contained in:
@@ -116,15 +116,12 @@ class Command(BaseCommand):
|
|||||||
legal_index.add_child(instance=privacy)
|
legal_index.add_child(instance=privacy)
|
||||||
privacy.save_revision().publish()
|
privacy.save_revision().publish()
|
||||||
|
|
||||||
site, _ = Site.objects.get_or_create(
|
# Update the existing default site (whatever hostname Wagtail created it with)
|
||||||
hostname="127.0.0.1",
|
# rather than creating a new 127.0.0.1 entry that leaves localhost pointing
|
||||||
port=8000,
|
# to the Welcome page.
|
||||||
defaults={
|
site = Site.objects.filter(is_default_site=True).first()
|
||||||
"root_page": home,
|
if site is None:
|
||||||
"is_default_site": True,
|
site = Site(hostname="localhost", port=80)
|
||||||
"site_name": "No Hype AI",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
site.root_page = home
|
site.root_page = home
|
||||||
site.is_default_site = True
|
site.is_default_site = True
|
||||||
site.site_name = "No Hype AI"
|
site.site_name = "No Hype AI"
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ services:
|
|||||||
working_dir: /app
|
working_dir: /app
|
||||||
command: >
|
command: >
|
||||||
sh -c "python manage.py migrate --noinput &&
|
sh -c "python manage.py migrate --noinput &&
|
||||||
|
python manage.py seed_e2e_content &&
|
||||||
python manage.py runserver 0.0.0.0:8000"
|
python manage.py runserver 0.0.0.0:8000"
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
- /opt/playwright-tools/browsers:/opt/playwright-tools/browsers:ro
|
|
||||||
ports:
|
ports:
|
||||||
- "8035:8000"
|
- "8035:8000"
|
||||||
environment:
|
environment:
|
||||||
@@ -22,7 +22,6 @@ services:
|
|||||||
EMAIL_BACKEND: django.core.mail.backends.console.EmailBackend
|
EMAIL_BACKEND: django.core.mail.backends.console.EmailBackend
|
||||||
DEFAULT_FROM_EMAIL: hello@nohypeai.com
|
DEFAULT_FROM_EMAIL: hello@nohypeai.com
|
||||||
NEWSLETTER_PROVIDER: buttondown
|
NEWSLETTER_PROVIDER: buttondown
|
||||||
PLAYWRIGHT_BROWSERS_PATH: /opt/playwright-tools/browsers
|
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
Reference in New Issue
Block a user