Django 1.9 removed get_cache from django.core.cache
See original GitHub issueRosetta 0.7.8, Django 1.9. Using memcached backend. Error:
rosetta/poutil.py
from django.core.cache import get_cache
ImportError: cannot import name 'get_cache'
Django 1.9 release notes: django.core.cache.get_cache is removed
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Django's cache framework
Set BACKEND to django.core.cache.backends.memcached. ... Be careful with this; clear() will remove everything from the cache, not just the keys set by your ......
Read more >Expire a view-cache in Django? - python - Stack Overflow
The cache_page decorator abstracts caching quite a bit for you and makes it hard to delete a certain cache object directly. You could...
Read more >Source code for django.utils.cache
This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses.
Read more >Caching in Django With Redis - Real Python
Personally, we like how easy it is to set up and use Redis for other purposes such as Redis Queue. Remove ads. Getting...
Read more >Django - Caching - Tutorialspoint
Django comes with its own caching system that lets you save your dynamic pages, to avoid calculating them again when needed. The good...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In your case the missing memcached exception was swallowed by that ImportError handler, but actually we no longer need that, as Rosetta only supports Django 1.7+ now. I’ve removed it in c80f2db4a3ec11bf8c5636db29ce0ceb278e4a7e
That gave the answer:
In my new Django 1.9 venv I hadn’t installed memcache! I hadn’t noticed it because the new rosetta code checked that I had an incompatible cache backend and when I enabled my production backed in dev the ImportError was being caught/handled by: https://github.com/mbi/django-rosetta/blob/develop/rosetta/poutil.py#L12
I guess you could do something to not hide that type of traceback:
But it could be brittle… or my situation is unusual… I could create a PR if you think this is valuable.
Sorry to have taken your time for my mistake. Thanks so much for all your help debugging this!