Flask Web应用程序无法在实时服务器上运行,但可以在本地服务器上运行

时间:2020-08-06 16:33:19

标签: sql python-3.x flask flask-sqlalchemy live

enter image description here

在本地服务器上,flask Web应用程序运行正常,但在实时服务器上,则无法运行 但是当我直接返回模板而不执行任何操作时,它也可以在实时服务器上运行。 例子

@app.route('/')
def index():
    if 'email' in session:
        status = "logout"
        return render_template('index.html', status=status)
    else:
        status = "login"
        return render_template('index.html', status=status)

以上代码在实时服务器上不起作用 但是下面的代码在实时服务器上运行良好。

@app.route('/')
def index():
    return render_template('index.html', status=status)

0 个答案:

没有答案