Flask-SSLify is a simple Flask extension that automatically redirects all incoming HTTP requests to HTTPS. It does this by setting a Strict-Transport-Security header in the response, which tells the user's browser to always use HTTPS for future requests. To use Flask-SSLify, simply install it using pip and then add the following lines to your Flask app:
from flask_sslify import SSLify
app = Flask(__name__)
sslify = SSLify(app)