Display PIL Image object

52 views
Skip to first unread message

Ben Sharif

unread,
Oct 1, 2014, 8:40:07 PM10/1/14
to web...@googlegroups.com
I am using qrcode library to generate a QR code. 

controller:
def create_qr():
    import qrcode
    text = "hello world test string"
    img = qrcode.make(text)  

    return locals()

view:
<img src="{{=img}}">


using the above code, img is being returned as a PIL Image object but the view is not displaying an image. 
how can I make the view display the generated PIL Image object? do i need to save the image somewhere first and if so, how?

thanks,

ben

Leonel Câmara

unread,
Oct 3, 2014, 4:18:20 AM10/3/14
to web...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages