I have a function in a view that renders the xml in the browser, but what I want is to save the xml content to a file, to be used in a Flash gallery.
def build_xml_menu(request):
rubros = Rubro.objects.all()
familias = Familia.objects.all()
context_data = {'rubros': rubros, 'familias': familias}
return render_to_response('menu.xml', context_data,
mimetype='application/xml')
How can the community help me do this or refer me to a guide that may aid me with this?
Thanks.
You have to use
render to stringinstead ofrender_to_response🙂