我是 Heroku 和 Gunicorn 的新手,所以我不确定这是如何工作的。但我做了一些搜索,我想我已经接近部署我的 Django 应用程序(1.5.1)了。所以我知道我需要一个 Procfile 其中
web: gunicorn app.wsgi
因为我的目录有点不同。我无法在根目录中运行gunicorn
app_project
requirements/
contributors/
app/
app/
settings/
wsgi.py
# Normally Procfile goes here
Procfile
通常 app/是根目录,但我决定以这种方式构建我的文件夹,以将我的 django 应用程序与其他一些东西分开。由于我必须将 Procfile 放在根目录中才能让 heroku 识别它,所以我应该在 Procfile 中放入什么和/或应该在 Gunicorn 命令中放置哪些参数?
注意:
web: gunicorn app.wsgi # won't work because Procfile is in a directory above
# I also want to keep the directories as is
# I also don't want to create a secondary git inside the app folder just for heroku
web: gunicorn app.app.wsgi # won't work because I don't want to convert the folder into a python module
最佳答案
尝试:
web: gunicorn --pythonpath app app.wsgi
关于python - 如何修改 Procfile 以在 Heroku 上的非标准文件夹中运行 Gunicorn 进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55828868/