title: What's the right procfile / requirements for heroku with django channels?
body: <p><strong>tl;dr - django channels app runs local with manage.py runserver but not on heroku.</strong></p>
  
  <p>I'm new to django channels - trying to deploy a very basic django app using channels to heroku.  I initially built the project using the standard <a href="https://docs.djangoproject.com/en/3.0/intro/tutorial01/" rel="noreferrer">django polls tutorial</a> and deployed that to heroku.  Then i added in a chat app using the <a href="https://channels.readthedocs.io/en/latest/tutorial/part_1.html" rel="noreferrer">django channels tutorial</a>.  Managed to get that running fine locally using docker to run a redis server as they suggested and "python manage.py runserver".  </p>
  
  <p>I'm getting stuck trying to deploy this to heroku or run it locally using heroku local.  I've already added the redis addon in heroku and modified settings.py to point to the REDIS_URL environment variable.  I also modified my template to use wss if appropriate (I believe that's necessary for heroku):</p>
  
  <pre><code>var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws";
          var target = ws_scheme + '://'
          + window.location.host
          + '/ws/chat/'
          + roomName
          + '/';
          const chatSocket = new WebSocket(
            target
          );
  ...
  </code></pre>
  
  <p>Thus I'm concluding that the problem is with the procfile.  I'm not sure what the instructions to use there are.  The initial polls tutorial used:</p>
  
  <pre><code>web: gunicorn gettingstarted.wsgi --log-file -
  </code></pre>
  
  <p>If I just use that 'heroku local' works fine and deploying works fine, but when I try to send a chat message it does nothing and shows a 404 in the console.  I know I have to change it to use an asgi server instead of gunicorn.  found <a href="https://github.com/jacobian/channels-example" rel="noreferrer">this tutorial</a> on deploying an app with channels to heroku, which used:</p>
  
  <pre><code>web: daphne chat.asgi:channel_layer --port $PORT --bind 0.0.0.0 -v2
  worker: python manage.py runworker -v2
  </code></pre>
  
  <p>I tried that, but that's where I get stuck.  Here's what I'm getting when I run heroku local:</p>
  
  <pre><code>krishnas-air:python-getting-started Krishna$ heroku local
  [OKAY] Loaded ENV .env File as KEY=VALUE Format
  6:46:50 PM worker.1 |  Traceback (most recent call last):
  6:46:50 PM worker.1 |    File "manage.py", line 8, in &lt;module&gt;
  6:46:50 PM worker.1 |      from django.core.management import execute_from_command_line
  6:46:50 PM worker.1 |  ImportError: No module named django.core.management
  [DONE] Killing all processes with signal  SIGINT
  6:46:50 PM worker.1 Exited with exit code null
  6:46:50 PM web.1    |  Traceback (most recent call last):
  6:46:50 PM web.1    |    File "/usr/local/bin/daphne", line 5, in &lt;module&gt;
  6:46:50 PM web.1    |      from daphne.cli import CommandLineInterface
  6:46:50 PM web.1    |    File "/usr/local/lib/python3.7/site-packages/daphne/cli.py", line 1, in &lt;module&gt;
  6:46:50 PM web.1    |      import argparse
  6:46:50 PM web.1    |    File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load
  6:46:50 PM web.1    |    File "&lt;frozen importlib._bootstrap&gt;", line 967, in _find_and_load_unlocked
  6:46:50 PM web.1    |    File "&lt;frozen importlib._bootstrap&gt;", line 677, in _load_unlocked
  6:46:50 PM web.1    |    File "&lt;frozen importlib._bootstrap_external&gt;", line 724, in exec_module
  6:46:50 PM web.1    |    File "&lt;frozen importlib._bootstrap_external&gt;", line 857, in get_code
  6:46:50 PM web.1    |    File "&lt;frozen importlib._bootstrap_external&gt;", line 525, in _compile_bytecode
  6:46:50 PM web.1    |  KeyboardInterrupt
  6:46:50 PM web.1    Exited with exit code null
  </code></pre>
  
  <p>The import error message made me think my requirements.txt could be missing something, so I've included that here as well for reference:</p>
  
  <pre><code>django
  gunicorn
  django-heroku
  requests
  channels
  channels_redis
  asgi_redis
  asgiref
  daphne
  redis
  gevent
  gevent-websocket
  greenlet
  </code></pre>
  
  <p>Thanks for any help!</p>