The scenario goes like this.
I get an atom file from a website (say A). A third party will be request this atom file through my website (say B).
I am writing a Django app which will frequently poll website A and store it as a file. Now, when a third party requests for the file through website B, I will have to display the file as xml in the browser.
My question is how do I render an entire xml file to a view in Django?
render_to_response
expects a template. I can’t use a template as such. I just need to display the file in the view. How do I do this?
If you don’t want to render a template, don’t do so.
renderis just a shortcut to render a template. If you just want to display text, just pass it into the HttpResponse.Since your data is in a file, this will work:
although you should beware of concurrency issues, if more than one person is accessing your site at a time.