Not sure why this happens, instead you can use the @login_required
annotation.
Remove the "login: required" from app.yaml and use this code in
home.py:

from google.appengine.ext.webapp.util import login_required
...
class MainPage(webapp,RequestHandler):
    @login_required
    def get(self):
        ...

The only drawback is that you have to add the annotation to all
handlers that require an authenticated user. On the other hand, this
gives you more flexibility.

On Aug 28, 5:20 pm, "shadow.hk" <[EMAIL PROTECTED]> wrote:
> I have created a page (login required) and test locally.
> After the login page, it gives me HTTP 500 error.
> and I get in my console:
> IOError: [Errno 9] Bad file descriptor
> And then if I refrest the page, there is no error and I can see the
> page.
>
> In app.yaml:
> - url: /.*
>   script: home.py
>   login: required
>
> In home.py,
> ...
> class MainPage(webapp,RequestHandler):
>   def get(self):
>     template_values = { 'foo' : 'bar' }
>     path = os.path.join(os.path.dirname(__file__), 'template.html')
>     self.response.out.write(template.render(path, template_values)
> ...
> application = webapp.WSGIApplication ([ ('/', MainPage) ], debug=True)
>
> Can any one give me a hint to solve the problem?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to