PythonAnywhereFlask500内柱

2024-09-29 23:27:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经通过PythonAnywhere部署了我的Flask应用程序,它显示,但是对于我的索引,我有一个登录页面,我尝试登录,在我按下Log-in之后,它加载了5秒钟,然后给我500个内部服务器错误-注意:在localhost上一切正常。在

错误日志:

2017-01-20 08:31:39,216 :/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/pymongo/topology.py:145: UserWarning: MongoClient opened before fork. Create MongoClient with connect=False, or create client after forking. See PyMongo's documentation for details: http://api.mongodb.org/python/current/faq.html#pymongo-fork-safe>
2017-01-20 08:31:39,216 :  "MongoClient opened before fork. Create MongoClient "
2017-01-20 08:32:09,239 :[2017-01-20 08:32:09,233] ERROR in app: Exception on / [POST]
2017-01-20 08:32:09,239 :Traceback (most recent call last):
2017-01-20 08:32:09,240 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
2017-01-20 08:32:09,240 :    response = self.full_dispatch_request()
2017-01-20 08:32:09,240 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
2017-01-20 08:32:09,240 :    rv = self.handle_user_exception(e)
2017-01-20 08:32:09,240 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
2017-01-20 08:32:09,240 :    reraise(exc_type, exc_value, tb)
2017-01-20 08:32:09,240 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
2017-01-20 08:32:09,240 :    rv = self.dispatch_request()
2017-01-20 08:32:09,240 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
2017-01-20 08:32:09,240 :    return self.view_functions[rule.endpoint](**req.view_args)
2017-01-20 08:32:09,240 :  File "/home/stanciu/oldstyle/untitled.py", line 23, in index
2017-01-20 08:32:09,240 :    login_user = users.find_one({'name' : request.form['username']})
2017-01-20 08:32:09,240 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/pymongo/collection.py", line 1102, in find_one
2017-01-20 08:32:09,240 :    for result in cursor.limit(-1):
2017-01-20 08:32:09,241 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/pymongo/cursor.py", line 1114, in next
2017-01-20 08:32:09,241 :    if len(self.__data) or self._refresh():
2017-01-20 08:32:09,241 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/pymongo/cursor.py", line 1036, in _refresh
2017-01-20 08:32:09,241 :    self.__collation))
2017-01-20 08:32:09,241 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/pymongo/cursor.py", line 873, in __send_message
2017-01-20 08:32:09,241 :    **kwargs)
2017-01-20 08:32:09,241 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/pymongo/mongo_client.py", line 888, in _send_message_with_response
2017-01-20 08:32:09,241 :    server = topology.select_server(selector)
2017-01-20 08:32:09,241 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/pymongo/topology.py", line 214, in select_server
2017-01-20 08:32:09,241 :    address))
2017-01-20 08:32:09,241 :  File "/home/stanciu/.virtualenvs/oldstyle/local/lib/python2.7/site-packages/pymongo/topology.py", line 189, in select_servers
2017-01-20 08:32:09,241 :    self._error_message(selector))
2017-01-20 08:32:09,241 :ServerSelectionTimeoutError: No servers found yet

Tags: inpyselfapphomelibpackageslocal

热门问题