Django tip: AttributeError: 'str' object has no attribute 'has_header'
(permalink)
Here's another quick Django tip that I couldn't find an answer for on google:
The error is the result of returning a string in a view instead of using HttpResponseRedirect. For example I accidentally wrote:
When what I meant was:
Hope that helps someone out there.
AttributeError: 'str' object has no attribute 'has_header'
The error is the result of returning a string in a view instead of using HttpResponseRedirect. For example I accidentally wrote:
return urlresolvers.reverse('crowd-detail')
When what I meant was:
return HttpResponseRedirect(urlresolvers.reverse('crowd-detail'))
Hope that helps someone out there.
Labels: django


Links to this post:
Create a Link
<< Home