Channels: How to set password for connection with redis?

Created on 20 May 2016  路  7Comments  路  Source: django/channels

Is there any such option in the channel?
As this password is specified in the config file?

Now I use this config:

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "asgi_redis.RedisChannelLayer",
        "ROUTING": "widget.routing.channel_routing",
        "CONFIG": {
            "hosts": [("127.0.0.1", 6379)],
        },
    },
}

Most helpful comment

It seems to me you do not know all the possibilities of your product.
I used here is just these settings:

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "asgi_redis.RedisChannelLayer",
        "ROUTING": "widget.routing.channel_routing",
        "CONFIG": {
            "hosts": [("redis://:[email protected]:6379/0")],
        },
    },
}

and it worked.
Close this issue now.

P.S.:
Add this info into your documentation. It may be useful for somebody.

All 7 comments

No, the backend does not support Redis passwords; I'll add it to the list of features to get in there, though encryption support is probably higher-priority as Redis passwords are really not secure.

It seems to me you do not know all the possibilities of your product.
I used here is just these settings:

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "asgi_redis.RedisChannelLayer",
        "ROUTING": "widget.routing.channel_routing",
        "CONFIG": {
            "hosts": [("redis://:[email protected]:6379/0")],
        },
    },
}

and it worked.
Close this issue now.

P.S.:
Add this info into your documentation. It may be useful for somebody.

Ah, fair enough, I didn't realise the redis backend string did that.

Does this issue fixed now??? I can't find the way to set redis password from document.

Just follow the example above and set it in the connection string.

Thank you so much @onegreyonewhite !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrewgodwin picture andrewgodwin  路  54Comments

andrewgodwin picture andrewgodwin  路  24Comments

joshua-s picture joshua-s  路  30Comments

kradem picture kradem  路  38Comments

ThaJay picture ThaJay  路  30Comments