Gunicorn/Django, ImportError: No module named application.wsgi
It seems your running directory is the outermost my-project
. Try to change your WSGI application path like gunicorn myproject.myproject.wsgi:application --log-file -
and see if the error changes.
I think putting your project in the root directory (i.e. removing the first myproject
directory and putting your manage.py
in my-project
directory) is a requirement for Heroku and will fix your problem.
I eventually fixed this using gunicorn's chdir flag which, as far as I understand it, essentially lets you pretend you're running gunicorn from another directory. Useful e.g. here where heroku tries to run gunicorn from one directory 'too low'.
To use it here you'd use in your Procfile:
web: gunicorn --chdir myproject myproject.wsgi:application --log-file -
i.e. you need the new:
--chdir myproject