【发布时间】:2013-12-22 09:59:47
【问题描述】:
我正在尝试通过 Gunicorn 在 Heroku 上运行 twoscoopsofdjango skeleton。
这是项目根目录的文件树(为了便于阅读,省略了一些不重要的文件夹):
.
├── LICENSE.txt
├── my_project
│ ├── manage.py
│ ├── my_project
│ │ ├── __init__.py
│ │ ├── settings
│ │ │ ├── base.py
│ │ │ ├── __init__.py
│ │ │ ├── local.py
│ │ │ ├── production.py
│ │ │ └── test.py
│ │ ├── urls.py
│ │ └── wsgi.py
│ └── templates
│ ├── 404.html
│ ├── 500.html
│ └── base.html
├── README.rst
├── requirements
│ ├── base.txt
│ ├── local.txt
│ ├── production.txt
│ └── test.txt
└── requirements.txt
现在我需要像从以下缩短树中的 my_project 文件夹中运行 Gunicorn 一样运行它:
.
├── LICENSE.txt
├── my_project
│ ├── manage.py
但是,我需要从 项目根目录 发出命令,因为 Heroku Procfile 仅在项目根目录的最低级别被拾取。
所以在本地的 shell 中,我只需 cd my_project 然后运行 gunicorn my_project.wsgi --settings=my_project.settings.production。但我不知道如何通过Procfile 做到这一点。
仅供参考,gunicorn --pythonpath=my_project my_project.wsgi --settings=my_project.settings.production 也不起作用。
【问题讨论】:
标签: django heroku gunicorn procfile