27 October 2017   3 comments   Python, Django

Released a new package today: django-cache-memoize

It's actually quite simple; a Python memoize function that uses Django's cache plus the added trick that you can invalidate the cache my doing the same function call with the same parameters if you just add .invalidate to your function.

The history of it is from my recent Mozilla work on Symbols.

I originally copy and pasted the snippet out that in a blog post and today I extracted it out into its own project with tests, docs, CI and a

I'm still amazed how long it takes to make a package with all the "fluff" around it. A lot of the bits in here (like and pytest.ini etc) are copied from other nicely maintained Python packages. For example, I straight up copied the tox.ini from Jannis Leidel's python-dockerflow. The ratio of actual code writing (including tests!) is far overpowered by the package sit-ups. But I "complain with a pinch of salt" because a lot of time spent was writing documentation and that's equally as important as the code probably.


Michał Pasternak

"The fluff around" is precisely why cookiecutter was invented for.

Peter Bengtsson

Yes and no. It's not that simple. It's not just a matter of making the files. I can get those by copying from other projects.

Peter Bengtsson

Also, best practices evolve and every time you use a template or a boilerplate solution, you either have to review it or maintain it.

Your email will never ever be published

Related posts

Concurrent Gzip in Python 13 October 2017
To enable Tracking Protection for performance 01 November 2017
Related by Keyword:
How to use django-cache-memoize 03 November 2017
cache_memoize - a pretty decent cache decorator for Django 11 September 2017
Fastest Redis configuration for Django 11 May 2017
Welcome to the world django-fancy-cache! 01 March 2013
Secs sell! How I cache my entire pages (server-side) 10 May 2012