When using a custom domain with a Google generated security certificate, how do I get http requests to redirect to the https?
I tried setting the Django property SECURE_SSL_REDIRECT to True in settings, but that didn't work.
Edit: Yes, this question already exists, but the solution only works with Python2.
SOLUTION: For my purposes, the solution was simply to switch from the Appengine Flexible environment to the Appengine Standard environment. I solved my SSL issues with the following app.yaml.
runtime: python37
entrypoint: gunicorn -b :$PORT <django-project-name>.wsgi
handlers:
- url: /.*
secure: always
redirect_http_response_code: 301
script: auto
beta_settings:
cloud_sql_instances: "<project-id>:<region>:<cloud-sql-instance>"