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

时间:2024-04-20 23:00:49

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

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

解决方案:

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()

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

要求密码需为字符串形式