/django-clear-caches

Clear django caches

Primary LanguagePythonMIT LicenseMIT

Django-Clear-Cache

A management command to clear a django CACHES store as defined in the django setting CACHES.

Warnings

This management command does a cache clear (removes all cached entries within the defined store). Dropping the cache without fully understanding its consequences is potentially harmful to your system stability. Make sure you understand what you are doing before running this command.

Usage

Adding to django

In django settings add to the INSTALLED_APPS, 'clear-caches'.

Parameters

--list - List of CACHES keys --cache-name - Clear the cache of a single CACHES key --all - Clear all cache entries for all CACHES keys -y - Used with --all as a command line confirmation of clearing all keys

Example Usage

List me the CACHES keys

> python manage.py clear_cache --list

< default
< data

Clear a single CACHES key

> python manage.py clear_cache --cache-name default

Clear multiple CACHES keys

> python manage.py clear_cache --cache-name default --cache-name data

Clear all CACHES keys

> python manage.py clear_cache --all -y