wagtail-headless-preview
wagtail-headless-preview copied to clipboard
[Documentation] on setting up sites to prevent DisallowedHosts error when deploying
If you don't have any sites configured on Wagtail (very possible if you're running headless) and don't have localhost in your Django ALLOWED_HOSTS, you'll get an error. But you can avoid adding localhost to your ALLOWED_HOSTS by setting up a site.
I figured this out by raising an issue against wagtail, maybe this should go somewhere in the readme?
Hey @david-morris,
That makes sense. Would you be able to submit a PR? I figure you're quite well placed to update the README from the point of view of someone who got bit by this
Sure, I'll talk Monday with my co-worker who made a migration to fix it automatically.
This is often solved by installing the django-cors-headers package and adding its corsheaders to INSTALLED_APPS, or did this not solve the original issue?