Code for outputting QR code through QRcode in Django

From , 2 Years ago, written in Python, viewed 227 times.
URL https://pastebin.vip/view/840d68cb
  1. from django.http import HttpResponse
  2. import qrcode
  3. from cStringIO import StringIO
  4. def generate_qrcode(request):
  5.     img = qrcode.make('http://www.sharejs.com')
  6.     buf = StringIO()
  7.     img.save(buf)
  8.     image_stream = buf.getvalue()
  9.     response = HttpResponse(image_stream, content_type="image/png")
  10.     return response
  11. #//python/9092

Reply to "Code for outputting QR code through QRcode in Django"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website