Chrome 此站点无法提供安全连接(heroku)

xe55xuns  于 11个月前  发布在  Go
关注(0)|答案(1)|浏览(109)

已尝试所有步骤:https://www.ssl2buy.com/wiki/how-to-fix-err-ssl-protocol-error


的数据
代码:https://techwithtim.net/tutorials/flask/a-basic-website/

from flask import Flask

# Defining the home page of our site
app = Flask(__name__)

if __name__ == "__main__":
    app.run()
   

@app.route("/")  # this sets the route to this page
def home():
    return "Hello! this is the main page <h1>HELLO</h1>"  # some basic inline [email protected]("/")  # this sets the route to this page

字符串

hvvq6cgz

hvvq6cgz1#

代码顺序不对。所有页面/路由都应该在运行应用程序之前定义(app.run())。我认为网站上的视频比你链接的网站更好地解释了这一点。
此外,这个问题与Heroku无关,所以我建议将其从标题中删除。

from flask import Flask

# Defining the home page of our site
app = Flask(__name__)

@app.route("/")  # this sets the route to this page
def home():
    return "Hello! this is the main page <h1>HELLO</h1>"

#moved this below @app.route
if __name__ == "__main__":
    app.run()

字符串

相关问题