MemcachedKeyCharacterError
See original GitHub issueHi,
I am trying to use the @memoize decorator to cache a method in a view, with python-memcached present, like below:
class BlogView(generic.ListView, CoreBreadcrumbs):
template_name = 'blog/blog.html'
context_object_name = 'items'
@memoize(timeout=3600)
def get_paginate_by(self, queryset):
return BlogSettings.objects.get().howmany_perpage
...
and I get the following error:
MemcachedKeyCharacterError: Control/space characters not allowed (key=':1:blog.views.BlogView.get_paginate_by.<blog.views.BlogView object at 0x03518AD0>_memver')
Full traceback - https://gist.github.com/DragosChirila/ce814ffd2a4d24e82c78c8cd013288e6
Am I doing something wrong here? Could you please advice?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Control/space characters not allowed · Issue #122 ... - GitHub
When trying to use this package with memcached, I get the following error: memcache.MemcachedKeyCharacterError: Control/space characters not allowed ...
Read more >MemcachedKeyCharacterError: Control characters not allowed
MemcachedKeyCharacterError : Control characters not allowed. Bug #634646 reported by Curtis Hovey on 2010-09-10. 6. This bug affects 1 person ...
Read more >Removing control/space characters from cache key in python
I have to remove control/space characters from my cache key. It is giving following error: MemcachedKeyCharacterError ...
Read more >MemcachedKeyCharacterError at /api/search - Jira Atlassian
NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report. Environment: Request Method: POST Request URL: http:// ......
Read more >memcache.Client.MemcachedKeyCharacterError Example
python code examples for memcache.Client.MemcachedKeyCharacterError. Learn how to use python api memcache.Client.MemcachedKeyCharacterError.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks! Indeed, using something like
seems to work.
On the other hand, I tried to use the make_name parameter but without success. Do you have a working example with a custom make_name method?
I did it like this:
where
But, make_name_for_view never gets called.