channels without channel layer or any other free hosting

前端 未结 1 473
日久生厌
日久生厌 2021-01-06 23:30

I have a project in django 2.0 nad django-channlels 2.0 which I need to host I followed the documentation and I was able to run channels on localhost along with redis but wh

相关标签:
1条回答
  • 2021-01-07 00:27

    from the docs

    Channel layers are an entirely optional part of Channels as of version 2.0. If you don’t want to use them, just leave CHANNEL_LAYERS unset, or set it to the empty dict {}.

    It will mean you will be unable to use self.channel_layer in the consumer, which you rely on.

    So, it's optional but you need it.

    In memory exists:

    CHANNEL_LAYERS={
        "default": {
            "BACKEND": "channels.layers.InMemoryChannelLayer"
         }
    }
    
    0 讨论(0)
提交回复
热议问题