A customizable implementation of Django's cache_page decorator.
Project description
A flexible implementation of Django's [`cache_page`](https://docs.djangoproject.com/en/dev/topics/cache/#the-per-view-cache) decorator.
# Description
This package provides two default ways to generate cache keys:
- generate_cache_key: similar to Django's default
- generate_query_params_cache_key
And allows you to define your custom key generation functions.
# Installation
```bash
pip install django-custom-cache-page
```
# Example
views.py:
```python
from django.http import HttpResponse
from custom_cache_page.cache import cache_page
from custom_cache_page.utils import generate_query_params_cache_key
@cache_page(60 * 60, generate_query_params_cache_key)
def my_view(request):
return HttpResponse("okay")
```
---
## Development installation
```bash
git clone https://github.com/zidsa/django-custom-cache-page.git
cd django-custom-cache-page
pip install --editable .
```
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
Built Distribution
Close
Hashes for django-custom-cache-page-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5611359cf548445ebc338d6bef6531faa86a48c81286e5cdc9c25c1416c58d10 |
|
MD5 | 6cdc7725421cb36ae65e405ea376a3f8 |
|
BLAKE2b-256 | 060ec2ffc4368ad7c219034b76652c358fb3f514b89719ff873ba77394dacf6f |
Close
Hashes for django_custom_cache_page-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebaf4cac9f1eeff869402d04d02367ab466718a89f82f2396145a58a866ed0a2 |
|
MD5 | 0b102fd9d2c24fe8856f0f227ef29892 |
|
BLAKE2b-256 | 4c6c9eabad68008333bbd7be8a15c38f520412e2f4969bb7484628dedb997046 |