Skip to content

smartfile/django-memcachedkeys

 
 

Repository files navigation

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',
    }
}

By default, pyhashxx is used to sanitize keys. To use a different backend:

'KEY_FUNCTION': 'memcachedkeys.make_key_md5',

Releases

No releases published

Packages

No packages published

Languages

  • Python 55.5%
  • Makefile 21.0%
  • Shell 20.0%
  • CSS 3.5%