Issue in django channels ASGI server - (TypeError: object HttpResponse can't be used in 'await' expression)

First, please do not tag any individual requesting assistance. (Personally, I don’t mind it all that much, because as a moderator, one of my duties is to read every message coming in. But in the general case, it’s not considered appropriate here.)

Second, from the traceback, I’m going to assume you’re trying to do this in Windows. I’m going to warn you about this - people generally have problems getting Daphne to work well in Windows. (See Django Channels with Redis slow intialization for one such example.) Now, those types of issues have nothing to do with what you’re facing here, but I’m just letting you know this in advance. (My understanding is that there is a way to work around these kinds of problems, but I’ve never found a definitive statement how - and since I abandoned Windows as a target platform many years ago, I’ve never spent the time trying to find an answer myself.)

Are you looking to run your Django code asynchronously? Or just the Channels websocket consumers?

At a minimum, to get started with this, we’ll need to see:

  • The command line being used to run your project.
  • These settings from your settings.py file:
    • INSTALLED_APPS
    • WSGI_APPLICATION
    • ASGI_APPLICATION
    • CHANNEL_LAYERS

Please post the contents of your asgi.py, and routing.py files. (This may just be the starting point. There might be more files needed to be seen.)