Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to disable cache for development in django? [duplicate]

Tags:

python

django

In some of my templates I'm using the {% cache %} template tag to cache some parts, but for development I don't want anything to be cached. I tried using a settings variable to set cache expiring time to zero for dev in a separate settings file and have it called with a context_processor, though it's not working.

Does anyone know a way to disable cache for dev environment?

Thanks for your help :)

like image 334
Gerard Avatar asked Jul 02 '12 16:07

Gerard


1 Answers

You can use django dummy caching for development:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
   }
}

https://docs.djangoproject.com/en/dev/topics/cache/?from=olddocs/#dummy-caching-for-development

like image 74
pahko Avatar answered Sep 23 '22 04:09

pahko