Creating an xml file w/ google app engine
I m currently using db.Model to store a string (already in xml format) how do I make this xml string publicly accessible (in the form o开发者_JAVA技巧f example.appspot.com/xml_file so firefox will recgonize it as xml or even of example.appspot.com) I see there is a function to_xml() but I dont know how to use it in such a way that firefox will recognize it as xml?? Thanks
Set the response content type to "text/xml".
If you're using GAE's webapp
framework use this in the request handler:
self.response.headers['Content-Type'] = 'text/xml'
If you're using another framework, like Django, look up setting the content type in their docs.
精彩评论