Templates Flask、Heroku和模板
更新:不确定原因,但在安装loggly之后,为了更深入地了解正在发生的事情,它现在正在工作。我不明白为什么会这样 我的flask webapp使用Foreman在本地工作,但是如果我在heroku上使用相同的测试输入,我会得到一个内部服务器错误:Templates Flask、Heroku和模板,templates,heroku,flask,Templates,Heroku,Flask,更新:不确定原因,但在安装loggly之后,为了更深入地了解正在发生的事情,它现在正在工作。我不明白为什么会这样 我的flask webapp使用Foreman在本地工作,但是如果我在heroku上使用相同的测试输入,我会得到一个内部服务器错误: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
日志几乎没有显示任何内容(这可能是一个单独的问题),但使用打印调试,我发现这与呈现模板有关,因为在此之前一切正常。考虑到它在本地工作,也就是说没有html错误,所以它必须是关于模板来源的
我的结构如下所示:
Procfile
venv
requirements.txt
app
/templates
/login.html
/user_profile.html
/index.html
/models
/views
...
如果我调整结构,使templates文件夹与Procfile、venv等处于同一级别,则没有页面可以工作,但实际上,index.html和login.html都显示得很好
知道怎么回事吗?非常感谢。你应该在你的帖子中添加一个答案并接受它,这样人们就会知道你的答案对他们也有帮助。谢谢