-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taking redis client from django.core.cache #82
Conversation
django 1.6 is no longer supported, support ended on April 1, 2015 https://www.djangoproject.com/download/#supported-versions did you mean another version? |
defender/connection.py
Outdated
@@ -18,6 +19,8 @@ def get_redis_connection(): | |||
""" Get the redis connection if not using mock """ | |||
if config.MOCK_REDIS: # pragma: no cover | |||
return MOCKED_REDIS # pragma: no cover | |||
elif config.DEFENDER_REDIS_NAME: # pragma: no cover | |||
return caches[config.DEFENDER_REDIS_NAME].get_master_client() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we talked about this in the issue #81 instead of adding the and to the elif, maybe we do a check above, and then display an error message and fail if the DEFENDER_REDIS_NAME is set but not available in caches. This way we still fail right away, and we give it a nice error message to let them know what is going on vs just a generic KeyError.
Well no, but travis-ci is still running tests over it, so I thought you still wanted to support it. Also it is still on the doc https://github.com/kencochrane/django-defender#requirements 😛 |
ha, yeah we should probably clean that up and remove support below django 1.8. |
Good. @kencochrane removed support for both versions 👍 |
thank you |
one note here, since we are dropping support for django < 1.8 we should remove python 2.6 as well from the test matrix since from django 1.8 only python 2.7 is supported https://docs.djangoproject.com/en/1.11/faq/install/#what-python-version-can-i-use-with-django |
@MattBlack85 Good catch, let's do that as well |
@kencochrane @MattBlack85 done, and added a little doc about the new setting. Who should I ask for a review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you!
The idea is to avoid rewriting the Redis URL on the defender settings, since probably you already have it on your django
CACHES
settings.Pending: