I am trying to set up a Django test project on Heroku. Following the tips here and at the beginning of Heroku I'm trying to use gunicorn
instead of the Django dev server.
This was my first attempt at Procfile:
web: gunicorn_django --workers=4 --bind=0.0.0.0:$PORT my_project/settings.py worker: python my_project/manage.py celeryd -E -B --loglevel=INFO
This gave me this error:
ImportError: Could not import settings 'settings.py' (Is it on sys.path?): No module named py
I decided to choose a different track and follow the recommendations here . Now my Procfile looked like this:
web: gunicorn_django -b 0.0.0.0:\$PORT -w 9 -k gevent --max-requests 250 --preload my_project.settings
(I also updated the requirements file to include gevent.) This gave me the same error:
ImportError: Could not import settings
Finally, I just set it to settings
:
web: gunicorn_django -b 0.0.0.0:\$PORT -w 9 -k gevent --max-requests 250 --preload settings
But now I get this error:
Error: django project not found
How my Django project is set up is that the settings.py
file is in the parent repo directory - I don't have a Django project in another directory. It is at the same level as virtualenv and git files. Would this be a problem? I am sure that I am doing something simple - any help would be greatly appreciated.
If I follow the instructions from Heroku here and change the Procfile to this:
web: gunicorn hellodjango.wsgi -b 0.0.0.0:$PORT
Nothing happens - there are no errors in the logs, but there are no processes, and the application just seems dead in the water.