seperman/redisworks

password option in initializer

wojtow opened this issue · 4 comments

My redis database requires a password, and redis python accepts one. Is it possible to add a password arg (defaulting to None) to the initializer?

    def __init__(self, host='localhost', port=6379, db=0,
                 return_object=True, password=None, *args, **kwargs):
        redis = kwargs.pop('redis', StrictRedis)
        super(Root, self).__init__(*args, **kwargs)
        self.red = redis(host=host, port=port, db=db, password=password)
        self.return_object = return_object
        self.setup()

I did this for my own use by subclassing Root and overridding __init__ to do this. But thought it would be a helpful improvement suggestion with trivial work, and no breakage of existing code.

Thanks for reporting @wojtow
I will implement this.

see #6

Still not added this enhancement? waiting for the update

Redistworks 0.3.0 is released and now one pass password in the parameters.