【发布时间】:2017-05-26 14:52:41
【问题描述】:
当我使用以下命令运行带有 gunicorn 的 Flask 应用程序时:
gunicorn --bind 127.0.0.1:8000 myapp:app
将浏览器设置为 www.mayapp.com 后出现以下错误
[ERROR] Error handling request /
Traceback (most recent call last):
File "/me/.virtualenvs/myapp/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 130, in handle
self.handle_request(listener, req, client, addr)
File "/me/.virtualenvs/myapp/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 171, in handle_request
respiter = self.wsgi(environ, resp.start_response)
TypeError: app() takes from 0 to 1 positional arguments but 2 were given
对于我正在使用的路线:
@app.route("/")
def index():
return render_template('myapp/index.html')
知道可能出了什么问题吗?
【问题讨论】:
标签: python nginx flask gunicorn