wagtail-nest / wagtail-bakery

A set of helpers for baking your Django Wagtail site out as flat files.
MIT License
179 stars 40 forks source link

build result's root "index.html" results in Bad Request #55

Closed monkut closed 4 years ago

monkut commented 4 years ago

I'm trying to automate publish to an s3 bucket, and am using the wagtail page_published signal to which connects to a function that uses, call_command() to call build.

This appears to work locally, but in my production environment on lambda/efs (via zappa/django-storages) the resulting index.html file seems to generate the following:


<!doctype html>
<html lang="en">
<head>
  <title>Bad Request (400)</title>
</head>
<body>
  <h1>Bad Request (400)</h1><p></p>
</body>
</html>

Any idea on how to debug this?

monkut commented 4 years ago

Ok, it appears that this was an issue with my django ALLOWED_HOSTS setting.

I had it set to only my deployed APIGW host set, needed to add localhost to allow the build command to execute;

Invalid HTTP_HOST header: 'localhost'. You may need to add 'localhost' to ALLOWED_HOSTS.

After adding localhost in addition to the APIGW host this is no longer an issue, closing.