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
[![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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for django_elephant-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1be77ae6da396721cdef582bfb67632c945f2921553ab4add30840950ce89d31 |
|
MD5 | 40ed47be9701e6f7c9055a54a8f96c2f |
|
BLAKE2b-256 | 6de12b0b998edc1268f815d9d0448137bead9e619e96ad7ed1cb7e6ec4d52af7 |