Skip to main content

Django cache backend for Amazon ElastiCache (memcached)

Project description

Simple Django cache backend for Amazon ElastiCache (memcached based). It uses pylibmc and setup connection to each node in cluster using auto discovery function.


  • pylibmc
  • Django 1.3+.

It was written and tested on Python 2.7.


Get it from pypi:

pip install django-pylibmc

or github:

pip install -e git://


Your cache backend should look something like this:

    'default': {
        'BACKEND': 'django_elasticache.memcached.ElastiCache',
        'LOCATION': '',

By the first call to cache it connects to cluster (using LOCATION param), gets list of all nodes and setup pylibmc client using full list of nodes. As result your cache will work with all nodes in cluster and automatically detect new nodes in cluster. List of nodes are stored in class-level cached, so any changes in cluster take affect only after restart of working process. But if you’re using gunicorn or mod_wsgi you usually have max_request settings which restart process after some count of processed requests, so auto discovery will work fine.

Django-elasticache changes default pylibmc params to increase performance.


Run the tests like this:


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-elasticache, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size django-elasticache-0.0.1.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page