I am doing a Heroku tutorial and web: python manage.py runserver 0.0.0.0:$PORT creates the error when I run heroku local or heroku local -p 5000 (or one of several more variants). However, web: python manage.py runserver 0.0.0.0:5000 works fine. I suspect I am making a simple error with how to pass an environment variable into the Procfile.
The error message is: CommandError: "0.0.0.0:$PORT" is not a valid port number or address:port pair.
The problem was a difference between Windows and Linux. The solution is below for others' benefit.
on linux,
$PORTreferences the variable called PORTon windows, we instead need
%PORT%Hence,
web: python manage.py runserver 0.0.0.0:%PORT%works for Procfile.windows. To run the Windows specific Procfile, runheroku local web -f Procfile.windowsas the normal Procfile file should be left withweb: python manage.py runserver 0.0.0.0:$PORTso it works when deployed (as heroku machines use linux)