Add your description here
Project description
Django FunCache
A Django app providing function-level caching with parameter-based keys and fixes for temporary file permissions.
Features
- Function-level caching with parameter-based cache keys
- Automatic cache key invalidation
- Compatible with Python 2.7 and Python 3.x
- Works with Django 1.11 and higher
Installation
# Using pip
pip install django-funcache
# Using uv
uv add django-funcache
Add to your INSTALLED_APPS:
INSTALLED_APPS = [
...
'funcache',
...
]
Usage
Function Caching
Set the cache key prefix for a specific model or a set of models to invalidate the cache when the model datas are updated.
from funcache import func_cache
# Using for a specific model
@func_cache(key_prefix='my_model')
def expensive_function(param1, param2):
# Function code here
return result
# Using for a set of models
@func_cache(key_prefix=['my_model1', 'my_model2'])
def expensive_function(param1, param2):
# Function code here
return result
The cache invalidator is managed by the funcache app through a signal.
Settings
You can customize the cache timeout:
# In settings.py
CACHE_TIMER = 1800 # 30 MINUTES (default is 1800 seconds/30 minutes)
Python 2 and 3 Compatibility
This package works with both Python 2.7 and Python 3.x environments. It's tested with:
- Python 2.7 with Django 1.11
- Python 3.6+ with Django 2.2, 3.2, and 4.x
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_funcache-0.1.0.tar.gz.
File metadata
- Download URL: django_funcache-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c91caa814b9a835057fd7159ee3664aceb075fecf52a09a2ad7fc3e51ef12662
|
|
| MD5 |
371ad6ce4232c643b37dc4c25503898f
|
|
| BLAKE2b-256 |
81e307ce8d95cde70a242ead4aaf9e891f73a229e900b302dd067c6b096affaf
|
File details
Details for the file django_funcache-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_funcache-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a4795f9a7042d7ae817cd4627734448abff537e2199c7f5b4830166dbb7ea98
|
|
| MD5 |
977c83578df0392adbb0299c8a1e6a0f
|
|
| BLAKE2b-256 |
27e4a789b642be39fa6854e7c551877d036e71358c722a74e80530d19b9113a8
|