django运行报错TypeError: object supporting the buffer API required

半城伤御伤魂 提交于 2019-12-05 10:57:12

运行django项目报错:TypeError: object supporting the buffer API required

 

 解决方案:

 

 将settings.py中数据库的密码改成字符串格式

源码:

def scramble_caching_sha2(password, nonce):
    # (bytes, bytes) -> bytes
    """Scramble algorithm used in cached_sha2_password fast path.

    XOR(SHA256(password), SHA256(SHA256(SHA256(password)), nonce))
    """
    if not password:
        return b''

    p1 = hashlib.sha256(password).digest()

 

 

要求密码需为字符串形式

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!