我正在尝试让我的 sanic webapp 与 uwsgi 一起工作,这就是我所做的:
调用我的 uwsgi.ini 文件:
uwsgi uwsgi.ini
内容:
[uwsgi]
http = :8001
wsgi-file = wsgi.py
asyncio = 10
wsgi.py:
from app import app as application
if __name__ == "__main__":
application.run()
应用程序.py:
import asyncio
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
from sanic import Sanic
from sanic.response import json
app = Sanic(__name__)
@app.route("/")
async def test(request):
return json({"foo": "bar"})
当我请求它时,我得到:
TypeError: __call__() takes 1 positional argument but 3 were given
我检查了 uwsgi 和 Sanic 文档,但可以找到任何提示……有人可以帮我解决这个问题吗?谢谢和问候!