Friday, 22 March 2019

Is it possible to enable caching from Django admin pages?

I have a Django-based website at ozake.com, and I am frequently rewriting parts of the programming.

Each time I work on it, I have to modify settings.py to disable caching.

I am using file-based caching. Here is the relevant part of settings.py:

CACHES = {
  'default': {'BACKEND':
 #'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
  'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
  'LOCATION': '/var/www/mysite.com/cache',

When I work on the site I comment out the last two lines and uncomment the dummy cache line.

This means SSH'ing into the site, modifying settings.py, working on the site, then re-modifying it.

Is there any way I can make this into a check box somewhere in /admin with admin.py?

Alternative idea: is it possible to disable caching for a visitor (me) with a specific IP address? If so, could I specify this IP address in /admin?



from Is it possible to enable caching from Django admin pages?

No comments:

Post a Comment