Render an xml to a view
Do something like the below:
return render(request, 'myapp/index.html', {"foo": "bar"}, content_type="application/xhtml+xml")
You just need to define the MIME type to 'text/xml'
using the content_type
argument:
return HttpResponse(open('myxmlfile.xml').read(), content_type='text/xml')