Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 646 Bytes

README.rst

File metadata and controls

26 lines (19 loc) · 646 Bytes

django-memcachedkeys

Memcached has some weird rules about its keys. Ignore them and you'll get an error like "MemcachedKeyCharacterError: Control characters not allowed". So install this.

Quickstart

Install django-memcachedkeys:

pip install django-memcachedkeys

Then use it in your settings file:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': '127.0.0.1:11211',
        'KEY_PREFIX': 'whatever',
        'KEY_FUNCTION': 'memcachedkeys.make_key',
    }
}