Registry / web-framework / django-memoize

django-memoize

JSON →
library2.3.1pypypi✓ verified 85d ago

An implementation of memoization technique for Django views and templates. Current version 2.3.1, with infrequent releases.

pip install django-memoize
INSTALL
IMPORT
SIG · DJANGO-MEMOIZE
D
django-memoize
web-frameworkpythonv2.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

memoize
from memoize import memoize

Decorate a function with @memoize(seconds) to cache its result for the given number of seconds.

from memoize import memoize @memoize(3600) def expensive_function(): return sum(i for i in range(1000000))
Debug
Known issues
gotchaThe memoize decorator caches in process memory; for persistent caching across processes (e.g., with Redis or memcached) you need a different library or manual cache layer.
fix
Use Django's cache framework directly if cross-process caching is required.
affects: all
deprecatedThe library has not been updated in several years and may have compatibility issues with newer Django versions (3.x, 4.x, 5.x). Test thoroughly.
fix
Consider using Django's built-in caching or other actively maintained memoization libraries.
affects: all
Errors
Common errors & fixes
ImportError: No module named memoize
The package name is 'django-memoize' but the import module is just 'memoize'.
fix
Run 'pip install django-memoize' and then import as 'from memoize import memoize'.
Upgrade
Version history
2.3.1latest on PyPI · released Apr 27, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
django-memoize — pip install django-memoize · libregistry