screenglow
screenglow

Reputation: 1886

How do I return an html file in a Google App Engine response?

Using the examples Google provides there they often encode the html responses by using:

self.response.write( "<html><p>Some stuff!</p></html>" )

This is a terrible way to hardcode html and in cases where I want to send back a nice looking page or a prefab, nicely designed response page it seems there ought to be a way to redirect the user directly to an actual nice_response.html.

I can't seem to find any example or docs on how to do this. Am I approaching it wrong or is there a simple way to direct a request to a real HTML page without hardcoding the response html?

Thanks

Upvotes: 0

Views: 359

Answers (1)

Wang
Wang

Reputation: 1038

What you need is templating. Take a look at this page https://cloud.google.com/appengine/docs/python/gettingstartedpython27/templates?hl=fr

Upvotes: 5

Related Questions