[google-appengine] Re: Error pages for 404 etc

2009-02-23 Thread Steffen 'stefreak' Neubauer
On Mon, 23 Feb 2009 23:25:48 +
Dave Warnock dwarn...@gmail.com wrote:
 How/where do I define my 404 page and get it to be displayed when I
 declare error(404)?
You have to send it as response to the client manually.
e.g. 
self.error(404)
self.response.out.write(htmlhead
titleNot Found/title
/headbody
h1404 - Not Found/h1
Sorry, but this file could not be found by our webserver.
/body/html)


signature.asc
Description: PGP signature


[google-appengine] Re: Error pages for 404 etc

2009-02-23 Thread Paul Roy

my way of doing it is to route to that handler any url that doesnt  
match any other handler in my app.

Sent from my iPhone

On 09-02-23, at 18:25, Dave Warnock dwarn...@gmail.com wrote:


 Hi,

 Using the built in web app framework I am declaring an error 404  
 like this:

 class Controller(webapp.RequestHandler):
  def get(self):
self.error(404)

 A 404 appears in the console but I do not see a 404 page.

 How/where do I define my 404 page and get it to be displayed when I
 declare error(404)?

 Thanks

 Dave
 -- 
 Dave Warnock: http://42.blogs.warnock.me.uk

 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Error pages for 404 etc

2009-02-23 Thread Dave Warnock

Thanks for the help. that works.

2009/2/23 Steffen 'stefreak' Neubauer stefr...@stefreak.de:
 On Mon, 23 Feb 2009 23:25:48 +
 Dave Warnock dwarn...@gmail.com wrote:
 How/where do I define my 404 page and get it to be displayed when I
 declare error(404)?
 You have to send it as response to the client manually.
 e.g.
 self.error(404)
 self.response.out.write(htmlhead
 titleNot Found/title
 /headbody
 h1404 - Not Found/h1
 Sorry, but this file could not be found by our webserver.
 /body/html)




-- 
Dave Warnock: http://42.blogs.warnock.me.uk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---