FAQ Database Discussion Community


Django - queryset caching request-independent?

python,django,django-queryset,django-cache
I need to cache a mid-sized queryset (about 500 rows). I had a look on some solutions, django-cache-machine being the most promising. Since the queryset is pretty much static (it's a table of cities that's been populated in advance and gets updated only by me and anyway, almost never), I...

After adding Django CMS to my project, management commands fail with a cache error. How can I fix it?

python,django,django-cms,django-cache
This is using Django 1.7 and Django CMS 3.1.0. I've had a large Django project that has been in production for months without any issue. I'm currently adding Django CMS to it and found that if my cache is offline, I cannot issue any management commands without getting an exception....

Django: cache a dictionary containing a lambda function

python,django,django-cache
I am trying to save a dictionary that contains a lambda function in django.core.cache. The example below fails silently. from django.core.cache import cache cache.set("lambda", {"name": "lambda function", "function":lambda x: x+1}) cache.get("lambda") #None I am looking for an explanation for this behaviour. Also, I would like to know if there is...

Possible interaction issue between Django 1.7.4 and django-cacheops 2.2.1

python,django,django-1.7,django-cache
I am upgrading a django app from 1.6 to 1.7. The app uses django-cacheops to store the results of a query. After the switch to Django 1.7 the following error is raised on all requests but the first one: Traceback (most recent call last): File "/data/virtualenv/default/lib/python2.7/site-packages/django/core/handlers/base.py", line 204, in get_response...