我的heroku應用程式不作業 我的代碼中也沒有看到任何錯誤,它非常簡單 模板中的index.html:
<! DOCTYPE html>
<html lang="en"/span>>
<head>/span>
<meta charset="UTF-8">/span>
<title> Srikar的訊息應用!</title>
</head>
</html>
app.py檔案:
fromflask import Flask, render_template, url_for, redirect, request, session
from flask_socketio import SocketIO, send
app = Flask(name)
@app.route("/")
def login() 。
return render_template('index.html'/span>)
@app.route("/home")
def home()。
return "welcome to homepage!"。
if name == "main":
app.run(debug=False,host="0.0.0.0"/span>)
要求檔案:
Flask==2.0.1
Flask-Login==0.5.0。
flask-ngrok==0.0.25。
Flask-SQLAlchemy==2.5.1。
future==0.18.2。
gevent==21.1.2。
gevent-websocket==0.10.1。
greenlet==1.1.0。
gunicorn==20.1.0。
python-socketio==5.4.0。
我的Procfile:
web。gunicorn app:app
uj5u.com熱心網友回復:
當在Heroku上使用Flask時,通常你需要系結到Heroku提供的埠上
。p = int(os.environ.get("PORT"/span>, 5000)
app.run(debug=False, port=p, host='0.0.0.0'/span>)
PS 最好同時發布Heroku的日志,這樣會有一些關于你遇到的問題的額外資訊
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/319749.html
標籤:
