[Answer]-Returning PNG with Django 1.7

1👍

So easy to find…. Just replaced “mimetype” with “content_type” 🙂

def generate_qrcode(request):
    img = qrcode.make("some string")
    response = HttpResponse(content_type="image/png")
    img.save(response, "PNG")
    return response    

Leave a comment