Our application adds certain properties to the HttpRequest object in
the __init__.py of the app like so:
def get_host(self):
if not hasattr(self, '_host'):
self._host = models.Host.by_name(self.get_host())
return self._host
HttpRequest.host = property(get_host)
This works most of the time, but sometimes it fails in short bursts
for a certain Appengine instance with the following error:
<type 'exceptions.AttributeError'>: 'WSGIRequest' object has no
attribute 'host'
when trying to access the host attribute of the HttpRequest.
I have made sure that the code in __init__.py runs for every instance.
I have also encountered this error sometimes when deploying, but it
went away after a few minutes.
The getter for the host property makes a query, but I suspect it's not
the query that fails because in that case the object would indeed have
that attribute, it would just be None.
Can anyone help?
Thank you
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.