小编典典

如何修改Procfile在Heroku的非标准文件夹中运行Gunicorn进程?

django

如何修改Procfile在Heroku的非标准文件夹中运行Gunicorn进程?我是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

阅读 447

收藏
2020-03-31

共1个答案

小编典典

尝试:

web: gunicorn --pythonpath app app.wsgi
2020-03-31