我正在尝试通过 Gunicorn 在 Heroku 上运行twoscoopsofdjango 骨架。
这是项目根目录的文件树(为了便于阅读,省略了一些不重要的文件夹):
.
├── 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
现在我需要运行 Gunicorn,就好像它是从my_project
以下缩短树中的文件夹运行一样:
.
├── LICENSE.txt
├── my_project
│ ├── manage.py
但是,我需要从项目根目录发出命令,因为 HerokuProcfile
只在项目根目录的最低级别上被拾取。
因此,在本地的外壳中,我将只是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
也不起作用。