공부
[Python] proxy image respnose content-type
승가비
2020. 7. 28. 23:15
728x90
def file(request, id):
image = get_object_or_404(Image, pk=id)
response = HttpResponse(urlopen(image.url).read())
response['Content-Type'] = image.type
return response
Setting Content-Type in Django HttpResponse object for Shopify App
I'm working on a Shopify app using Django, which I am hosting on a VPS with nginx and gunicorn. I am trying to change the Content-Type of an HttpResponse object to application/liquid, so that I ca...
stackoverflow.com
728x90