On Wed, Jul 14, 2010 at 8:48 PM, Jonathan Hayward <christos.jonathan.hayw...@gmail.com> wrote: > I am working on debugging a basic template, and after correcting some other > error, I got: > > Traceback (most recent call last): > > File > "/usr/local/lib/python2.6/site-packages/django/core/servers/basehttp.py", > line 280, in run > self.result = application(self.environ, self.start_response) > > File > "/usr/local/lib/python2.6/site-packages/django/core/servers/basehttp.py", > line 674, in __call__ > return self.application(environ, start_response) > > File > "/usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line > 245, in __call__ > response = middleware_method(request, response) > > File > "/usr/local/lib/python2.6/site-packages/django/contrib/sessions/middleware.py", > line 26, in process_response > patch_vary_headers(response, ('Cookie',)) > > File "/usr/local/lib/python2.6/site-packages/django/utils/cache.py", line > 127, in patch_vary_headers > if response.has_header('Vary'): > > AttributeError: 'SafeUnicode' object has no attribute 'has_header' > > This wasn't the usual format for a Django traceback, and the traceback is > only in Django code, no reference to my project. > Suggestions? Would it make sense to open a bug? >
The error isn't triggered in your code, but it is triggered by your code. You must return a HttpResponse object from a view, not a string. Whatever view you are hitting here is returning a SafeUnicode, so it is probably coming from a template renderer. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.