Skip to content
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

Deprecated importlib module and deprecated get_cache #60

Closed
SimonSteinberger opened this issue Mar 22, 2015 · 2 comments
Closed

Deprecated importlib module and deprecated get_cache #60

SimonSteinberger opened this issue Mar 22, 2015 · 2 comments
Milestone

Comments

@SimonSteinberger
Copy link

Django's importlib module will be removed with the next version (1.9).
Also, 'get_cache' is deprecated in favor of 'caches'.

Please replace in utils.py:

from django.utils.importlib import import_module

With the Python importlib:

from importlib import import_module

You can modify the get_cache import like that, so it works with all Django versions:

try:
----from django.core.cache import caches
except:
----from django.core.cache import get_cache as caches

Then load the cache like so:

cache = hasattr(caches, 'call') and caches(cache_name) or caches[cache_name]

Wonderful tool by the way! Thank you :-)

@SimonSteinberger SimonSteinberger changed the title Deprecated importlib module Deprecated importlib module and deprecated get_cache Mar 23, 2015
@jieter
Copy link

jieter commented Apr 2, 2015

Just updated to 1.8 and got the warnings too, would be nice if these will be fixed.

jieter added a commit to jieter/django-ratelimit that referenced this issue Apr 2, 2015
jieter added a commit to jieter/django-ratelimit that referenced this issue Apr 2, 2015
jieter added a commit to jieter/django-ratelimit that referenced this issue Apr 10, 2015
jieter added a commit to jieter/django-ratelimit that referenced this issue Apr 10, 2015
askedrelic pushed a commit to seatme/django-ratelimit that referenced this issue May 13, 2015
@jsocol
Copy link
Owner

jsocol commented Aug 7, 2015

Fixed by #70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants