redis.exceptions.AuthenticationError: Authentication required.报错解决办法
报错
...
File "D:\UserData\PycharmProject\pythonProject\私有项目\gsCoWeChat\venv\lib\site-packages\redis\client.py", line 1239, in <lambda>
lambda: self._send_command_parse_response(
File "D:\UserData\PycharmProject\pythonProject\私有项目\gsCoWeChat\venv\lib\site-packages\redis\client.py", line 1215, in _send_command_parse_response
return self.parse_response(conn, command_name, **options)
File "D:\UserData\PycharmProject\pythonProject\私有项目\gsCoWeChat\venv\lib\site-packages\redis\client.py", line 1254, in parse_response
response = connection.read_response()
File "D:\UserData\PycharmProject\pythonProject\私有项目\gsCoWeChat\venv\lib\site-packages\redis\connection.py", line 824, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
File "D:\UserData\PycharmProject\pythonProject\私有项目\gsCoWeChat\venv\lib\site-packages\redis\connection.py", line 334, in read_response
raise error
redis.exceptions.AuthenticationError: Authentication required.
...
原因
redis没有设置认证密码
解决办法
CACHES = {
'default': {
...
'OPTIONS': {
...
'PASSWORD': 'yourpassword' # 密码
}
}
}