0
我很有趣的做一个非常薄的烧瓶接口到我的mongo数据库---只是一些简单的索引和窗体来显示和编辑我的数据。复制Flask + MongoDB得到内部服务器错误
我跟随this tutorial从MongoDB,有一些补充from this one这也有帮助。
我第一次运行python manage.py runserver
,一切正常。但是,增加的观点,和模板后,第二次运行python manage.py runserver
的应用似乎会失败:
Internal Server Error
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.
我有app.run(debug=True)
,但有在控制台中没有额外的错误日志:
$ python manage.py runserver
* Running on http://localhost:5000/
* Restarting with reloader
127.0.0.1 - - [28/May/2013 14:45:14] "GET/HTTP/1.1" 500 -
127.0.0.1 - - [28/May/2013 14:45:14] "GET /favicon.ico/ HTTP/1.1" 404 -
这儿还有没有人还有这个问题吗?教程中是否存在缺失的内容,或者是否有更好的方法来确定我的错误在哪里?有关在MongoDB上设置最小Flask图层的任何其他建议,我们也会赞赏!
我做了那个教程,并记住它有一些错误,我不得不修复。你能分享你的代码吗? – codegeek
确实,我们需要看一些代码来弄清楚。然而,这个错误似乎也让我很熟悉。本教程使用一种破解方式将父目录包含在系统路径中,这在manage.py文件中完成。确保设置正确。 – Teisman
我会看看我能否以一种合理的方式列出这些文件,或者上传到github什么的。与此同时,泰斯曼,我认为你是对的黑客。我在交互式命令行中运行以下命令:'sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__ file__),'..'))) '它有一些投诉。 '__file__'没有被定义。 – Mittenchops