運行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()
要求密碼需為字符串形式