Last active
February 2, 2023 00:09
-
-
Save mchurichi/9978cc672252fd87db6bedc9d4df4633 to your computer and use it in GitHub Desktop.
How to run a Flask app locally over https
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.cli.command() | |
def secure(length): | |
context = ('certs/server.crt', 'certs/server.key') | |
app.run(host='0.0.0.0', port=443, debug=True, ssl_context=context) | |
#$ export FLASK_APP=wsgi.py flask secure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to generate self-signed certs: https://devcenter.heroku.com/articles/ssl-certificate-self