

def get_otpauth_url(accountname, secret, issuer=None, digits=None):
    accountname = accountname.encode('utf8')
    issuer = (issuer.encode('utf8') if issuer else None)
    label = quote((b': '.join([issuer, accountname]) if issuer else accountname))
    query = [('secret', secret), ('digits', (digits or totp_digits()))]
    if issuer:
        query.append(('issuer', issuer))
    return ('otpauth://totp/%s?%s' % (label, urlencode(query)))

dataset/ETHPy150Open Bouke/django-two-factor-auth/two_factor/utils.py get_otpauth_url/original