How can I modify Procfile to run Gunicorn process in a non-standard folder on Heroku?
As @Graham Dumpleton stated in his answer, the OP's problem could be solved by modifying his Procfile to the following:
web: gunicorn --pythonpath app app.wsgi
Why this works:
- Remember, that the Procfile is simply used by Heroku to start processes. In this case, gunicorn processes.
- Gunicorn's
--pythonpath
argument allows you to dynamically attach a directory to the list of directories that the Python runtime searches for when do module look-ups. - By adding
--pythonpath app
to the gunicorn command, the interpreter was basically told 'look inside of the app directory for a package (also) called app which contains a module called wsgi.`
The generic names of the folders in the OP's question can obscure the syntax of the command, which is as follows:gunicorn --pythonpath <directory_containing_package> <package>.<module>
More Info:
Gunicorn Documentation