DEV Community

Discussion on: How do you host a website for free?

 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Have you tried --

python flask redirect to https from http

28

I have a website build using python3.4 and flask...I have generated my own self-signed certificate and I am currently testing my website through localhost.

I am using the python ssl module along with this flask extension: github.com/kennethreitz/flask-sslify

context = ('my-cert.pem', 'my-key.pem')
app = Flask(__name__)
sslify = SSLify(app)

...

if __name__

You don't need a real SSL certificate, BTW. Just need to differentiate DEVELOPMENT from PRODUCTION.

You can also adapt this code, as some of the things are Heroku-specific.

help.heroku.com/J2R1S4T8/can-herok...