2👍
If you are using datetime
objects for created_at
and duration
, make sure you render them to strings.
1👍
Pickle does not deal well with functions.
Check out this answer for some insight: https://stackoverflow.com/a/1253813/4225229
You could serialize the result of the function (try json.dumps()
) and cache that.
- [Django]-MultipleHiddenInput doesn't encode properly over POST?
- [Django]-I added a SECRET_KEY config variable to my Django app on Heroku but now it won't work locally
- [Django]-Allow only one concurrent login per user in django app
- [Django]-Django ForeignKey null = true
- [Django]-How to connect React with Django?
0👍
I converted the dictionary with json as Jacob suggested like this:
cache.set('podcasts', json.dumps(podcasts))
👤Atma
- [Django]-ImportError: No module named django.core.wsgi (ubuntu)
- [Django]-How do I retrieve a value of a field in a queryset object
- [Django]-Django duplicate queries with manager related
- [Django]-Django REST framework: using object-level permissions without model-level permissions
Source:stackexchange.com