Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 715 Bytes

README.md

File metadata and controls

35 lines (25 loc) · 715 Bytes

rcmemoize (Django)

Cache anything in the current request cycle in memory for preventing duplicate method callers.
It works for Django only for now. But can be contributed to extend other Python Web Frameworks like Flask, Bottle, TurboGears etc.

Installation

pip install rcmemoize

Configuration

Add INSTALLED_APPS
rcmemoize
Add bottom of the of the MIDDLEWARE_CLASSES
rcmemoize.middleware.memoization_middleware.RequestCycleMemoizationMiddleware

Usage

from rcmemoize.memoization import request_cycle_memoize

@request_cycle_memoize()
def your_method(*args,**kwargs):
...

CONTRIBUTE

All contributions are very welcomed!