Skip to main content

A simple cache for Django functions and methods

Project description

# django-elephant

[![Build Status](https://travis-ci.org/jairhenrique/django-elephant.svg)](https://travis-ci.org/jairhenrique/django-elephant)
[![PyPI version](https://badge.fury.io/py/django-elephant.svg)](https://badge.fury.io/py/django-elephant)
[![Coverage Status](https://coveralls.io/repos/jairhenrique/django-elephant/badge.svg?branch=master&service=github)](https://coveralls.io/github/jairhenrique/django-elephant?branch=master)
[![Code Issues](https://www.quantifiedcode.com/api/v1/project/03084631935244baa8335617d6502d11/badge.svg)](https://www.quantifiedcode.com/app/project/03084631935244baa8335617d6502d11)


*django-elephant is a simple wrapper to cache responses of Django methods or functions*


## Setup

```bash
pip install django-elephant
```

## Usage
```python
from elephant import memorize

def make_cache_key(function, *args, **kwargs):
return function.__name__

@memorize(cache_key=make_cache_key, timeout=10000)
def foo(bar):
return bar

```


## Requirements
- Django>=1.4


## Todo
- Create generic cache key function

Project details


Download files

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

Source Distribution

django-elephant-0.0.2.tar.gz (3.6 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page