1. Jason Moiron
  2. johnny-cache
Issue #66 new

TypeError on get

Murph Murphy
created an issue

Using the setup from the docs with PyLibMC.

When I start up the server and start browsing, I can see things being stored in memcached in the console. As soon as a get shows up in memcached though, I get a TemplateSyntaxError.

{{{

!python

Traceback: File "/env/pfenv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 117. response = middleware_method(request, e) File "/env/pfenv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, callback_args, callback_kwargs) File "/env/pfenv/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper 307. return self.admin_site.admin_view(view)(*args, kwargs) File "/env/pfenv/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view 93. response = view_func(request, args, kwargs) File "/env/pfenv/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func 79. response = view_func(request, *args, kwargs) File "/env/pfenv/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner 197. return view(request, args, kwargs) File "/env/pfenv/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper 28. return bound_func(*args, kwargs) File "/env/pfenv/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view 93. response = view_func(request, args, kwargs) File "/env/pfenv/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func 24. return func(self, *args2, kwargs2) File "/env/pfenv/lib/python2.7/site-packages/django/contrib/admin/options.py" in changelist_view 1179. ], context, context_instance=context_instance) File "/env/pfenv/lib/python2.7/site-packages/django/shortcuts/init.py" in render_to_response 20. return HttpResponse(loader.render_to_string(*args, kwargs), httpresponse_kwargs) File "/env/pfenv/lib/python2.7/site-packages/django/template/loader.py" in render_to_string 188. return t.render(context_instance) File "/env/pfenv/lib/python2.7/site-packages/django/template/base.py" in render 123. return self._render(context) File "/env/pfenv/lib/python2.7/site-packages/django/template/base.py" in _render 117. return self.nodelist.render(context) File "/env/pfenv/lib/python2.7/site-packages/django/template/base.py" in render 744. bits.append(self.render_node(node, context)) File "/env/pfenv/lib/python2.7/site-packages/django/template/debug.py" in render_node 73. result = node.render(context) File "/env/pfenv/lib/python2.7/site-packages/django/template/loader_tags.py" in render 127. return compiled_parent._render(context) File "/env/pfenv/lib/python2.7/site-packages/django/template/base.py" in _render 117. return self.nodelist.render(context) File "/env/pfenv/lib/python2.7/site-packages/django/template/base.py" in render 744. bits.append(self.render_node(node, context)) File "/env/pfenv/lib/python2.7/site-packages/django/template/debug.py" in render_node 73. result = node.render(context) File "/env/pfenv/lib/python2.7/site-packages/django/template/loader_tags.py" in render 127. return compiled_parent._render(context) File "/env/pfenv/lib/python2.7/site-packages/django/template/base.py" in _render 117. return self.nodelist.render(context) File "/env/pfenv/lib/python2.7/site-packages/django/template/base.py" in render 744. bits.append(self.render_node(node, context)) File "/env/pfenv/lib/python2.7/site-packages/django/template/debug.py" in render_node 73. result = node.render(context) File "/env/pfenv/lib/python2.7/site-packages/django/template/defaulttags.py" in render 310. if var: File "/env/pfenv/lib/python2.7/site-packages/django/contrib/messages/storage/base.py" in len 69. return len(self._loaded_messages) + len(self._queued_messages) File "/env/pfenv/lib/python2.7/site-packages/django/contrib/messages/storage/base.py" in _loaded_messages 88. messages, all_retrieved = self._get() File "/env/pfenv/lib/python2.7/site-packages/django/contrib/messages/storage/fallback.py" in _get 24. messages, all_retrieved = storage._get() File "/env/pfenv/lib/python2.7/site-packages/django/contrib/messages/storage/user_messages.py" in _get 44. for user_message in queryset: File "/env/pfenv/lib/python2.7/site-packages/django/db/models/query.py" in _result_iter 107. self._fill_cache() File "/env/pfenv/lib/python2.7/site-packages/django/db/models/query.py" in _fill_cache 772. self._result_cache.append(self._iter.next()) File "/env/pfenv/lib/python2.7/site-packages/django/db/models/query.py" in iterator 273. for row in compiler.results_iter(): File "/env/pfenv/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in results_iter 698. row = self.resolve_columns(row, fields) File "/env/pfenv/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py" in resolve_columns 12. return row[:index_extra_select] + tuple(values)

Exception Type: TemplateSyntaxError at /admin/django_messages/message/ Exception Value: Caught TypeError while rendering: cannot concatenate 'str' and 'tuple' objects

}}}

I'm not sure if it's a bug in the actual app, but at the very least there must be a bug in the docs somewhere in relation to this. My settings.py is:

{{{

!python

CACHES = { 'default': { 'BACKEND': 'johnny.backends.memcached.PyLibMCCache', 'LOCATION': ['127.0.0.1:11211'], 'JOHNNY_CACHE': True, } } JOHNNY_MIDDLEWARE_KEY_PREFIX = 'productfunder'

MIDDLEWARE_CLASSES = ( 'johnny.middleware.LocalStoreClearMiddleware', 'johnny.middleware.QueryCacheMiddleware', ... } }}}

Comments (1)

  1. Log in to comment