From 18725f82da861c3ae4a94a4dbc131db0411f07a5 Mon Sep 17 00:00:00 2001 From: chang-ning Date: Sat, 5 Mar 2016 00:25:31 +0800 Subject: [PATCH] Add always redirectory to https --- app.py | 3 +++ requirements.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/app.py b/app.py index 5eb0d0da..22a05185 100644 --- a/app.py +++ b/app.py @@ -4,11 +4,14 @@ import os from flask import Flask, send_from_directory +from flask_sslify import SSLify DIR = os.path.dirname(os.path.realpath(__file__)) ROOT = os.path.join(DIR, 'docs', '_build', 'html') app = Flask(__name__) +if 'DYNO' in os.environ: + sslify = SSLify(app) @app.route('/') def static_proxy(path): diff --git a/requirements.txt b/requirements.txt index bcc149d7..6470c585 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,5 @@ snowballstemmer==1.2.1 Sphinx==1.3.5 sphinx-rtd-theme==0.1.9 Werkzeug==0.11.4 +Flask-SSLify==0.1.5 wheel==0.24.0