42👍
✅
from django.core.cache import cache
cache._cache.flush_all()
Also see this ticket, it has a patch (that I haven’t tested) to flush any type of cache backend: http://code.djangoproject.com/ticket/11503
2👍
And an one-liner from console:
echo "from django.core.cache import cache; cache._cache.flush_all()" | ./manage.py shell [--settings=myapp.settings_live]
- [Django]-How does get_FIELD_display (in django) work?
- [Django]-Running a specific test case in Django when your app has a tests directory
- [Django]-What is a Django "app" supposed to mean?
- [Django]-Django model with 2 foreign keys from the same table
- [Django]-How to mock python's datetime.now() in a class method for unit testing?
- [Django]-How do you configure Django for simple development and deployment?
Source:stackexchange.com