6👍
Maybe you installed channels version 4 which is the latest, default one, and this does not start the ASGI server in development mode. please verify this and install channels version == 3.0.5 . do verify ASGI server starts when you run the runserver command.
( Version 4 supports ASGI server via daphne, I guess so, not tried.)
If not let me know will discuss more.
4👍
-
For
channels==4.0.0
there was a change mentioned here which requires that you also putdaphne
inINSTALLED_APPS
, beforedjango.contrib.staticfiles
. Run alsopip install -U 'channels[daphne]' channels-redis
to be sure you have compatibledaphne
andchannels-redis
versions. -
Alternatively, seems that running
daphne <your main app>.asgi:application
from within your root of your project (wheremanage.py
is) instead of thepython manage.py runserver
works. -
Additionally, as mentioned before, downgrading to
channels==3.0.5
is another way to make it work without addingdaphne
to yourINSTALLED_APPS
.
0👍
you are missing this in settings.py file
ASGI_APPLICATION = 'appname.asgi.application'