Django Channel 2 with Daphne on Heroku crash on starting
Your Procfile should have this instead :
release: python3 manage.py makemigrations && python3 manage.py migrateweb: daphne domecode.asgi:application --port $PORT --bind 0.0.0.0 -v2worker: python3 manage.py runworker channel_layer -v2
channel_layer
instead of channels
. Why? Well, look at your settings again, you've declared CHANNEL_LAYER there which you run locally on a Redis instance on Docker. However when deploying you can't run it on Docker ( I mean you technically can use Docker Swarms on Digital Ocean or AWS, I'm not sure how it works on Heroku ) so you need to change it to channel_layer
.
Have you created an instance of the process web in heroku?You can do it in command line : heroku ps:scale worker=1
Give worker in Procfile as:
worker: python manage.py runworker channels --settings=<project-name>.settings -v2