【发布时间】:2021-09-08 23:20:05
【问题描述】:
我的 heroku 应用程序无法运行 我的代码中也没有看到任何错误,这很简单 模板中的 index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Srikar's Messaging App!</title>
</head>
</html>
app.py 文件:
from flask 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')
@app.route("/home")
def home():
return "welcome to homepage!"
if name == "main":
app.run(debug=False,host="0.0.0.0")
需求文件:
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
我的档案:
web: gunicorn app:app
【问题讨论】:
-
不是
name,是__name__。不过,可能还有无数其他问题,我们需要一些调试信息才能了解这些问题。 -
哦在堆栈溢出中它没有注册 __ 和 __ ,用于使文本变为粗体
-
代码其实很简单。