I've deployed a Django project on Google Cloud standard AppEngine,
- My Domain Name is registered in Google Domains which confirms that it already points to my project when I try to customize my domains.
- On the Web, I've access my project under its project name:
https://mooveup-9645.oa.r.appspot.com
- However when I try
https://my-domain.fr
the web site cannot be accessed. My Question is: Where should I add my domain name ?
if APPENGINE_URL:
# Ensure a scheme is present in the URL before it's processed.
if not urlparse(APPENGINE_URL).scheme:
APPENGINE_URL = f"https://{APPENGINE_URL}"
ALLOWED_HOSTS = [urlparse(APPENGINE_URL).netloc, "www.my-domain.fr", "my-domain.fr"]
Is this the appropriate solution in Django settings or is there another configuration step with GCP?
CodePudding user response:
You must add the Custom Domain in the GCP console:
https://console.cloud.google.com/appengine/settings/domains?project={your_project}
CodePudding user response:
On Google Cloud tutorial to deploy an Django project on AppEngine, some steps are skipped.
- On Django Settings complete the
ALLOWED_HOSTS
with your domain name. - If you have a Standard AppEngine in order to avoid the overload of the Engine, the better is to deploy and then delete the former versions, in order to alleviate the risk of Error
502
:
$ gcloud app deploy --project PROJECT_ID --promote
$ gcloud app versions list --project PROJECT_ID //to get the older versions
$ gcloud app versions delete VERSION_ID
Then:
On https://console.cloud.google.com/appengine/settings
, you should customize your domain name and end your domain name with a DOT in order to get the DNS records and then update them on https://domains.google.com/registrar/