且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Gunicorn/Django,导入错误:没有名为 application.wsgi 的模块

更新时间:2022-05-21 21:25:49

看来你的运行目录是最外层的my-project.尝试更改您的 WSGI 应用程序路径,如 gunicorn myproject.myproject.wsgi:application --log-file - 并查看错误是否发生变化.

It seems your running directory is the outermost my-project. Try to change your WSGI application path like gunicorn myproject.myproject.wsgi:application --log-file - and see if the error changes.

我认为将您的项目放在根目录中(即删除第一个 myproject 目录并将您的 manage.py 放在 my-project目录)是 Heroku 的要求,它将解决您的问题.

I think putting your project in the root directory (i.e. removing the first myproject directory and putting your manage.py in my-project directory) is a requirement for Heroku and will fix your problem.