Django - gunicorn on App Engine. Error: 'No Mo

2019-06-08 11:44发布

I'm trying to upload my Django(v2.0) application to Google App Engine, but Gunicorn(v19.7.1) can't find my app. When I deploy my app using gcloud app deploy I get error

'No Module Named AppFlex'

Full screenshot of the error and app.yaml config is below.

enter image description here

The contents of the wsgi.py are:

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AppFlex.settings")

application = get_wsgi_application()

Additionally, I can run the app locally using:

gunicorn AppFlex.wsgi --workers 16

Another screenshot where I can run the app using gunicorn locally :

enter image description here

1条回答
戒情不戒烟
2楼-- · 2019-06-08 12:09

I think the issue is that your top level module (AppFlex) is camel-cased, and for some reason App Engine expects only lower case module names.

If you change your module name to appflex and update the corresponding configuration in app.yaml and everywhere else that your top level module is referenced (e.g., in wsgi.pi) it should work.

I am not too sure why App Engine is doing that, but it is convention for modules to be lower case, and I'd strongly suggest you follow that convention.

查看更多
登录 后发表回答