I am hosting on GAE and want to be able to access different versions without promoting them. Currently, I get a 400 error: Invalid HTTP_HOST header: '1234568-dot-myapp.ey.r.appspot.com'. You may need to add '1234568-dot-myapp.ey.r.appspot.com' to ALLOWED_HOSTS.
How can I add the URL to ALLOWED_HOSTS, so that I can access any version of my app? Currently, my ALLOWED_HOSTS looks like this:
APPENGINE_URL = env("APPENGINE_URL", default=None)
if APPENGINE_URL:
if not urlparse(APPENGINE_URL).scheme:
APPENGINE_URL = f"https://{APPENGINE_URL}"
ALLOWED_HOSTS = [urlparse(APPENGINE_URL).netloc,
'my-personal-domain.com']
CSRF_TRUSTED_ORIGINS = [APPENGINE_URL,
'https://my-personal-domain.com']
SECURE_SSL_REDIRECT = True
else:
ALLOWED_HOSTS = ["*"]
From my understanding, wildcards only work for sub-domains. How can I add something like this to the allowed hosts?
[version-number]-dot-myapp.ey.r.appspot.com
Thanks!