kumidc/frontend/templatetags/qrcode.py

10 lines
203 B
Python
Raw Normal View History

2022-08-04 11:15:10 +00:00
import pyqrcode
from django import template
register = template.Library()
@register.simple_tag()
def url_to_qrcode(url):
return "data:image/png;base64," + pyqrcode.QRCode(url).png_as_base64_str()