For local:
If you follow this official heroku tutorial and you are running it on Window platform locally, instead of $PORT
, you have to use %PORT%
at your Procfile.windows
:
web: python manage.py runserver 0.0.0.0:%PORT%
since window does not interpret $PORT
expression which only applicable in Unix shells.
If one using waitress
as WSGI and wanna run it locally on Window platform, your Procfile
should looks like this:
web: waitress-serve --port=%PORT% wsgi:your_app
For real online deployment:
simply include gunicorn
package in requirementx.txt
and your Procfile
should be in this way:
web: gunicorn wsgi:your_app
If you are using waitress
, you need to change back to $PORT
, and set it in this way instead of fixed port number since Heroku assigns port to your app dynamically. Also, do make sure the host is set to 0.0.0.0
so your app is available externally.