For displaying an xml file, use
response = HttpResponse(mimetype="text/xml")
response.write('<?xml version="1.0"?>')
response.write('<data>No Data</data>')
return responseFor displaying image, use
im = Image.open("nature.png") # use PIL library
response = HttpResponse(mimetype="image/png")
im.save(response, "PNG")
return response
No comments:
Post a Comment