title: Django on Google App Engine add version URL's to ALLOWED_HOSTS
body: <p>I am hosting on GAE and want to be able to access different versions without promoting them. Currently, I get a 400 error: <code>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.</code></p>
  <p>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:</p>
  <pre class="lang-py prettyprint-override"><code>APPENGINE_URL = env(&quot;APPENGINE_URL&quot;, default=None)
  if APPENGINE_URL:
      if not urlparse(APPENGINE_URL).scheme:
          APPENGINE_URL = f&quot;https://{APPENGINE_URL}&quot;
  
      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 = [&quot;*&quot;]
  </code></pre>
  <p>From my understanding, wildcards only work for sub-domains. How can I add something like this to the allowed hosts?
  <code>[version-number]-dot-myapp.ey.r.appspot.com</code></p>
  <p>Thanks!</p>