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
Source:stackexchange.com