Error: gunicorn: Failed to find application object 'app' in 'app'

后端 未结 2 1294
醉梦人生
醉梦人生 2020-12-11 15:36

Here\'s my code:

app.py

from flask_graphql import GraphQLView
from app.infrastructure.graphql import schema
from app.infrastructure.api_resource impo         


        
相关标签:
2条回答
  • 2020-12-11 16:08

    You have a folder called app (as by the import lines in your file) and a app.py file.

    Gunicorn will try to find the app WSGI variable inside the app module, which in your case is identified as app/__init__.py

    You need to rename your folder or your app.py file to avoid this conflict.

    0 讨论(0)
  • 2020-12-11 16:09

    I found that this bug only happens on gunicorn version 20+. When I downgrade to version 19.9.0, it works fine even with the folder and app.py sharing the same name.

    0 讨论(0)
提交回复
热议问题