qr_code/qrcode/maker.py
def make_embedded_qr_code(text, qr_code_options=QRCodeOptions()):
    """
    Generates a <svg> or <img> tag representing the QR code for the given text. This tag can be embedded into an
    HTML document.
    """
    image_format = qr_code_options.image_format
    img = make_qr_code_image(text, SvgEmbeddedInHtmlImage if image_format == SVG_FORMAT_NAME else PilImageOrFallback, qr_code_options=qr_code_options)
    stream = BytesIO()
    if image_format == SVG_FORMAT_NAME:
        img.save(stream, kind=SVG_FORMAT_NAME.upper())
        html_fragment = (str(stream.getvalue(), 'utf-8'))
    else:
        img.save(stream, format=PNG_FORMAT_NAME.upper())
        html_fragment = 'data:image/png;base64, %s' % (str(base64.b64encode(stream.getvalue()), encoding='ascii'))
#        html_fragment = '<img src="data:image/png;base64, %s" alt="%s">' % (str(base64.b64encode(stream.getvalue()), encoding='ascii'), escape(text))
    return mark_safe(html_fragment)

    Generates a <svg> or <img> tag representing the QR code for the given text. This tag can be embedded into an
    HTML document.
    
Generates a  or  tag representing the QR code for the given text. This tag can be embedded into an
HTML document.
Generates a or tag representing the QR code for the given text . This tag can be embedded into an HTML document .
def make_embedded_qr_code(text, qr_code_options=QRCodeOptions()):
    image_format = qr_code_options.image_format
    img = make_qr_code_image(text, SvgEmbeddedInHtmlImage if image_format == SVG_FORMAT_NAME else PilImageOrFallback, qr_code_options=qr_code_options)
    stream = BytesIO()
    if image_format == SVG_FORMAT_NAME:
        img.save(stream, kind=SVG_FORMAT_NAME.upper())
        html_fragment = (str(stream.getvalue(), 'utf-8'))
    else:
        img.save(stream, format=PNG_FORMAT_NAME.upper())
        html_fragment = 'data:image/png;base64, %s' % (str(base64.b64encode(stream.getvalue()), encoding='ascii'))
    return mark_safe(html_fragment)
def make_embedded_qr_code ( text , qr_code_options = QRCodeOptions ( ) ) : image_format = qr_code_options . image_format img = make_qr_code_image ( text , SvgEmbeddedInHtmlImage if image_format == SVG_FORMAT_NAME else PilImageOrFallback , qr_code_options = qr_code_options ) stream = BytesIO ( ) if image_format == SVG_FORMAT_NAME : img . save ( stream , kind = SVG_FORMAT_NAME . upper ( ) ) html_fragment = ( str ( stream . getvalue ( ) , 'utf-8' ) ) else : img . save ( stream , format = PNG_FORMAT_NAME . upper ( ) ) html_fragment = 'data:image/png;base64, %s' % ( str ( base64 . b64encode ( stream . getvalue ( ) ) , encoding = 'ascii' ) ) return mark_safe ( html_fragment )
Generates a <svg> or <img> tag representing the QR code for the given text.
Generates a <svg > or <img > tag representing the QR code for the given text .
"""
    Generates a <svg> or <img> tag representing the QR code for the given text. This tag can be embedded into an
    HTML document.
    """ #        html_fragment = '<img src="data:image/png;base64, %s" alt="%s">' % (str(base64.b64encode(stream.getvalue()), encoding='ascii'), escape(text))
text
qr_code_options