How to force Google App Engine [python] to use SSL (https)?

I am writing a web application in Google App Engine using Python.

Users can access my site at http : // [youraccount] .appspot.com and https : // [youraccount] .appspot.com

How to redirect http traffic to https website.

In other words, how to get this site to use SSL(https) for security purposes (and for better SEO)?

+6
source share
1 answer

Just add the secure parameter to the app.yaml file.

 handlers: - url: /youraccount/.* script: accounts.py login: required secure: always 

See Configure Secure URLs in app.yaml

The Google App Engine supports secure HTTPS connections for URLs using the *.appspot.com domain. When a request accesses a URL using HTTPS, and that URL is configured to use HTTPS in the app.yaml file, the request data and response data are encrypted by the sender before they are transmitted and decrypted by the recipient after they are received. Secure connections are useful for protecting customer data, such as contact information, passwords, and private messages.

+7
source

Source: https://habr.com/ru/post/983219/


All Articles