I forgot to mention: after I submit the code to appengine, I am not
getting error 500 but a blank page.
I have to refresh to get to the main page...  Is there anything
wrong?  What should I check?


On Sep 1, 11:57 pm, "shadow.hk" <[EMAIL PROTECTED]> wrote:
> Same problem.  Still Error 500.
>
> The page is generated by template:
>     path = os.path.join(os.path.dirname(__file__), 'template.html')
>     self.response.out.write(template.render(path, template_values))
>
> From console:
> ...
> </html>ERROR    2008-09-01 15:53:50,937 dev_appserver.py] Exception
> encountered
> handling request
> Traceback (most recent call last):
>   File "c:\program files\google\google_appengine\google\appengine\tools
> \dev_apps
> erver.py", line 2276, in _HandleRequest
>     base_env_dict=env_dict)
>   File "c:\program files\google\google_appengine\google\appengine\tools
> \dev_apps
> erver.py", line 349, in Dispatch
>     base_env_dict=base_env_dict)
>   File "c:\program files\google\google_appengine\google\appengine\tools
> \dev_apps
> erver.py", line 1762, in Dispatch
>     self._module_dict)
>   File "c:\program files\google\google_appengine\google\appengine\tools
> \dev_apps
> erver.py", line 1680, in ExecuteCGI
>     reset_modules = exec_script(handler_path, cgi_path, hook)
>   File "c:\program files\google\google_appengine\google\appengine\tools
> \dev_apps
> erver.py", line 1586, in ExecuteOrImportScript
>     sys.stdout.seek(0)
> IOError: [Errno 9] Bad file descriptor
> INFO     2008-09-01 15:53:50,937 dev_appserver.py] "GET / HTTP/1.1"
> 500 -
>
> On Aug 28, 4:23 pm, Alexander Kojevnikov <[EMAIL PROTECTED]>
> wrote:
>
> > 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