Configuring gunicorn for Django on Heroku

后端 未结 4 1011
梦毁少年i
梦毁少年i 2021-01-05 19:24

I\'m trying to setup a test Django project on Heroku. Following the advice here and in the Heroku Getting Started I\'m trying to use gunicorn instead of the Dj

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-05 19:36

    I had the same exact issue that you are having. The way I was able to finally get it working was to use the django app gunicorn.

    I added gunicorn to the django settings.py

    'gunicorn',
    

    I then used this as my web entry in my Procfile.

    web: python manage.py run_gunicorn -b 0.0.0.0:\$PORT -w 9 -k gevent --max-requests 250 --preload
    

    You may have to alter you .manage.py if you use a different directory structure then I did. My app was in /app, and my python path was also /app.

提交回复
热议问题