File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
appengine/standard_python3/django Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ runtime: python39
2020
2121env_variables :
2222 # This setting is used in settings.py to configure your ALLOWED_HOSTS
23- # APPENGINE_URL: https:// PROJECT_ID.uc.r.appspot.com
23+ # APPENGINE_URL: PROJECT_ID.uc.r.appspot.com
2424
2525handlers :
2626# This configures Google App Engine to serve the files in the app's static
Original file line number Diff line number Diff line change 6767# to App Engine. This code takes the URL and converts it to both these settings formats.
6868APPENGINE_URL = env ("APPENGINE_URL" , default = None )
6969if APPENGINE_URL :
70- # Ensure the HTTPS is in the URL before it's used.
71- APPENGINE_URL = urlparse (APPENGINE_URL , "https" ).geturl ()
70+ # Ensure a scheme is present in the URL before it's processed.
71+ if not urlparse (APPENGINE_URL ).scheme :
72+ APPENGINE_URL = f"https://{ APPENGINE_URL } "
7273
73- ALLOWED_HOSTS = [APPENGINE_URL ]
74- CSRF_TRUSTED_ORIGINS = [urlparse ( APPENGINE_URL ). netloc ]
74+ ALLOWED_HOSTS = [urlparse ( APPENGINE_URL ). netloc ]
75+ CSRF_TRUSTED_ORIGINS = [APPENGINE_URL ]
7576 SECURE_SSL_REDIRECT = True
7677else :
7778 ALLOWED_HOSTS = ["*" ]
You can’t perform that action at this time.
0 commit comments