Connect with us

Setting Content-Type in Django HttpResponse object for Shopify App

If you are working on a shopify app using Django and trying to change the Content-Type of HttpResponse object to application/liquid for use the shopify application proxy feature, you can use below code:

def featured(request):
  response = HttpResponse("", content_type="application/liquid; charset=utf-8")
  response['Content-Length'] = len(content)
  response.write('<html><body>test hello moto</body></html>')
  return response

Your Answer

Please login or Register to submit your answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.

Log In

Subscribe to our newsletter

Enter your email address to subscribe to blog and receive notifications of new articles by email.
100% Privacy. No spam guaranteed