fix: auto-set Wagtail site hostname on startup #16

Merged
codex_a merged 2 commits from fix/prod-site-hostname into main 2026-02-28 22:08:30 +00:00
Showing only changes of commit 349f1db721 - Show all commits

View File

@@ -6,6 +6,14 @@ python manage.py tailwind build
python manage.py migrate --noinput python manage.py migrate --noinput
python manage.py collectstatic --noinput python manage.py collectstatic --noinput
# Set Wagtail site hostname from first entry in ALLOWED_HOSTS
python manage.py shell -c "
from wagtail.models import Site
import os
hostname = os.environ.get('ALLOWED_HOSTS', 'localhost').split(',')[0].strip()
Site.objects.update(hostname=hostname, port=443, site_name='No Hype AI')
"
exec gunicorn config.wsgi:application \ exec gunicorn config.wsgi:application \
--workers 3 \ --workers 3 \
--bind 0.0.0.0:8000 \ --bind 0.0.0.0:8000 \