I'm using redis-py binding in Python 2 to connect to my Redis server. The server requires a password. I don't know how to AUTH
after making the connection in Python.
The following code does not work:
import redis
r = redis.StrictRedis()
r.auth('pass')
It says:
'StrictRedis' object has no attribute 'auth'
Also,
r = redis.StrictRedis(auth='pass')
does not work either. No such keyword argument.
I've used Redis binding in other languages before, and usually the method name coincides with the Redis command. So I would guess r.auth
will send AUTH
, but unfortunately it does not have this method.
So what is the standard way of AUTH
? Also, why call this StrictRedis
? What does Strict
mean here?
on_connect() Initialize the connection, authenticate and select a database
. Ask andymccurdy, Redis says redis-py is mature and supported, the way to go. – Deenadeenya