django - Setting requirepass on redis throws 'NOAUTH Authentication required'
问题描述
I tried using the options setting to provide the password as such:
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'OPTIONS': {
"PASSWORD": 'pass', }, 'CONFIG': {
'hosts': [('localhost', 6379)], }
}
}
Despite this, it is erroring:
Exception Value: NOAUTH Authentication required.
I found the following SO:
Redis raise error: NOAUTH Authentication required but there is no password setting
But the answers were not helpful in this situation.
解决方案
Note: If you have any special symbols in your password it will throw base 10 error. You're going to either have to convert the password to be url friendly or use a password without special characters.
CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgi_redis.RedisChannelLayer",
"CONFIG": {
"hosts": [("redis://:mypassword@127.0.0.1:6379/0")],
},
},
}
Credits to PanosTrak from Discord and this github issue
推荐阅读
- node.js - 如何在 ExpressJS 中使用 SendGrid 发送电子邮件
- amazon-ec2 - ec2 实例持续运行
- python - Python:错误的 ip 显示在数据包头中
- mysql - 仅加载数据本地 Infile 从 csv 文件的第一列加载值
- swift - MapView 一开始不显示所有图钉
- windows - 将 laravel 应用程序密码与 Active Directory 同步
- ruby-on-rails - 如何按照 json api 规范使用 rswag 创建?
- wordpress - 类别页面上的 Woocommerce 产品图像轮播
- node.js - reCAPTCHA 错误 Node.js:错误:char 处的未知 base64 编码:�
- java - 登录到外部 Api 并将 JSON 发布到它