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

Posted pfeiliu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章

Django urls.py报错: raise TypeError('view must be a callable or a list/tuple in the case of includ

Django :执行 python manage.py makemigrations 时报错 TypeError: __init__() missing 1 required positional a

Django TypeError: isinstance() arg 2 must be a type or tuple of types

Django ConnectionAbortedError + TypeError + AttributeError

在Django中使用ForeignKey()报错问题的解决

Django App TypeError django.views.i18n.javascript_catalog