Compare commits
1 Commits
fix/dev-wh
...
tests/e2e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95abbdc0ac
|
@@ -116,16 +116,17 @@ class Command(BaseCommand):
|
|||||||
legal_index.add_child(instance=privacy)
|
legal_index.add_child(instance=privacy)
|
||||||
privacy.save_revision().publish()
|
privacy.save_revision().publish()
|
||||||
|
|
||||||
# Point every existing Site at the real home page and mark exactly one
|
# Update the existing default site (whatever hostname Wagtail created it with)
|
||||||
# as the default. Wagtail's initial migration creates a localhost:80
|
# rather than creating a new 127.0.0.1 entry that leaves localhost pointing
|
||||||
# site that matches incoming requests by hostname before the
|
# to the Welcome page.
|
||||||
# is_default_site fallback is ever reached, so we must update *all*
|
site = Site.objects.filter(is_default_site=True).first()
|
||||||
# sites, not just the is_default_site one.
|
|
||||||
Site.objects.all().update(root_page=home, site_name="No Hype AI", is_default_site=False)
|
|
||||||
site = Site.objects.first()
|
|
||||||
if site is None:
|
if site is None:
|
||||||
site = Site(hostname="localhost", port=80)
|
site = Site(hostname="localhost", port=80)
|
||||||
|
site.root_page = home
|
||||||
site.is_default_site = True
|
site.is_default_site = True
|
||||||
|
site.site_name = "No Hype AI"
|
||||||
site.save()
|
site.save()
|
||||||
|
# Remove any other conflicting default-site entries left by test fixtures
|
||||||
|
Site.objects.exclude(pk=site.pk).filter(is_default_site=True).update(is_default_site=False)
|
||||||
|
|
||||||
self.stdout.write(self.style.SUCCESS("Seeded E2E content."))
|
self.stdout.write(self.style.SUCCESS("Seeded E2E content."))
|
||||||
|
|||||||
@@ -4,13 +4,6 @@ DEBUG = True
|
|||||||
|
|
||||||
INTERNAL_IPS = ["127.0.0.1"]
|
INTERNAL_IPS = ["127.0.0.1"]
|
||||||
|
|
||||||
# In dev, drop WhiteNoise from middleware and use plain static file storage.
|
|
||||||
# WhiteNoise serves from STATIC_ROOT which is empty without collectstatic,
|
|
||||||
# so it intercepts every /static/ request and returns nothing.
|
|
||||||
# Django's runserver handles static files natively when DEBUG=True.
|
|
||||||
MIDDLEWARE = [m for m in MIDDLEWARE if m != "whitenoise.middleware.WhiteNoiseMiddleware"]
|
|
||||||
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import debug_toolbar # noqa: F401
|
import debug_toolbar # noqa: F401
|
||||||
|
|
||||||
|
|||||||
@@ -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,6 +22,7 @@ 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