text: from flask import *
  import os
  
  app = Flask(__name__)
  
  @app.before_request
  def before_request():
      if 'DYNO' in os.environ:
          if request.url.startswith('http://'):
              url = request.url.replace('http://', 'https://', 1)
              code = 301
              return redirect(url, code=code)
  
  @app.route("/")
  def home():
      return render_template("home.html")
  
  if __name__ == "__main__":
      app.run(debug=not('DYNO' in os.environ))
  