I have a simple code that will generate QR code, But I want the generated QR code to be displayed in a new tab, I already achieved displaying the image in the current page, but I want it to be opened in a new tab instead.
code = form.code.data
qr = pyqrcode.create(code)
qr.png(code+'.png', scale=6)
with open(code+'.png', "rb") as f:
return Response(f.read(), content_type="image/png")
P.S: Edited it for future readers.