'bool' object has no attribute 'has_header'

839 views
Skip to first unread message

Olx

unread,
May 24, 2011, 12:23:38 PM5/24/11
to Pinax Core Development
Hello everyone!

I'm using Pinax-0.9a1 with Django-1.3 and generated "social" project.
When I try to access http://localhost:8000/tweets/friends_tweets/ I'm
getting the following:

AttributeError at /tweets/friends_tweets/
'bool' object has no attribute 'status_code'
Request Method: GET
Request URL: http://localhost:8000/tweets/friends_tweets/
Django Version: 1.3
Exception Type: AttributeError
Exception Value:
'bool' object has no attribute 'status_code'
Exception Location: /Volumes/Data/Documents/Projects/demo/eggs/
django_debug_toolbar-0.8.3-py2.7.egg/debug_toolbar/middleware.py in
process_response, line 98
Python Executable: /Library/Frameworks/Python.framework/Versions/2.7/
Resources/Python.app/Contents/MacOS/Python
Python Version: 2.7.1


When I disable django toolbar application completely the following
happens:


AttributeError at /tweets/friends_tweets/
'bool' object has no attribute 'has_header'
Request Method: GET
Request URL: http://localhost:8000/tweets/friends_tweets/
Django Version: 1.3
Exception Type: AttributeError
Exception Value:
'bool' object has no attribute 'has_header'
Exception Location: /Volumes/Data/Documents/Projects/demo/parts/
americandream/django/utils/cache.py in patch_vary_headers, line 127
Python Executable: /Library/Frameworks/Python.framework/Versions/2.7/
Resources/Python.app/Contents/MacOS/Python
Python Version: 2.7.1

The same error happens when some of the templates is missing. The
major pain is debugging application with such error reporting. It
takes 20-30 minutes to figure out what's wrong the next time you see
it.

Anyone experienced the similar?

Thank you in advance,
Alex

Oleksandr Lobunets

unread,
May 24, 2011, 4:57:05 PM5/24/11
to pinax-c...@googlegroups.com
After some debugging it appeared that the non-usable errors are caused by a Pinax middleware:

pinax.middleware.security.HideSensistiveFieldsMiddleware in MIDDLEWARE_CLASSES.

If messes up the response object passed further along the chain. If you disable it all works as expected. But I'm not sure yet how that impacts Pinax functionality.

> --
> You received this message because you are subscribed to the Google Groups "Pinax Core Development" group.
> To post to this group, send email to pinax-c...@googlegroups.com.
> To unsubscribe from this group, send email to pinax-core-de...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pinax-core-dev?hl=en.
>

Michael Ayukawa

unread,
Jun 28, 2011, 8:06:52 AM6/28/11
to pinax-c...@googlegroups.com
Hi,
I certainly don't have any answers as to what is going on.  Only some supportive observations that might help someone more knowledgeable provide some much needed guidance.  I had a very similar "'bool' object has no attribute 'status_code' ".  Also using social project but on Ubuntu 10.04 LTS.  
What I find odd is that things seem to work fine when using the development server but throw these errors when serving from Apache2 mod_wsgi.  
Any help on how to get started on debugging this problem would be appreciated.  I'd like to help fix the problem and learn.
New to django, pinax, and pistons.  
Thanks,
Mike

Michael Ayukawa

unread,
Jun 29, 2011, 8:14:31 AM6/29/11
to pinax-c...@googlegroups.com
Turned out to be a path problem for mod_wsgi.  Could not find pistons.  The section in the Pinax documentation is a bit thin in this area.  If I ever get this sorted out in a clean and proper manner (still reading the mod_wsgi documentation), I'll post it here and maybe it can make its way into the Pinax documentation.  /Mike

Brian Rosner

unread,
Jul 18, 2011, 3:33:08 PM7/18/11
to pinax-c...@googlegroups.com
On Tue, May 24, 2011 at 10:23 AM, Olx <alexander...@gmail.com> wrote:
> Anyone experienced the similar?

Sorry for the delayed response. I believe this was fixed in
https://github.com/pinax/pinax/commit/7e045b134630f3b4546082a9ddde4e6fce4483e4

--
Brian Rosner
http://twitter.com/brosner

Reply all
Reply to author
Forward
0 new messages