Skip to content

Commit

Permalink
Set usage of StrictRedis as default
Browse files Browse the repository at this point in the history
  • Loading branch information
underyx committed Jul 18, 2016
1 parent 4103de9 commit 2e90800
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ History
- **Backwards incompatible:** The extension will now be registered under the (lowercased) config prefix of the instance.
The default config prefix is ``'REDIS'``, so unless you change that, you can still access the extension via
``app.extensions['redis']`` as before.
- **Backwards incompatible:** The default class has been changed to ``redis.StrictRedis``. You can switch back to the
old ``redis.Redis`` class by specifying ``strict=False`` in the ``FlaskRedis`` kwargs.

0.2.0 (4/15/2015)
-----------------
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ or
redis_store.init_app(app)
return app
or perhaps you want to use ``StrictRedis``
or perhaps you want to use the old, plain ``Redis`` class instead of ``StrictRedis``

.. code-block:: python
Expand All @@ -86,7 +86,7 @@ or perhaps you want to use ``StrictRedis``
from redis import StrictRedis
app = Flask(__name__)
redis_store = FlaskRedis.from_custom_provider(StrictRedis, app)
redis_store = FlaskRedis(app, strict=False)
or maybe you want to use
`mockredis <https://github.com/locationlabs/mockredis>`_ to make your unit
Expand Down
2 changes: 1 addition & 1 deletion flask_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class FlaskRedis(object):

def __init__(self, app=None, strict=False, config_prefix='REDIS'):
def __init__(self, app=None, strict=True, config_prefix='REDIS'):
self._redis_client = None
self.provider_class = redis.StrictRedis if strict else redis.Redis
self.config_prefix = config_prefix
Expand Down

0 comments on commit 2e90800

Please sign in to comment.