search

Home  >  Q&A  >  body text

python - Flask TypeError: Expected bytes

PHPzPHPz2893 days ago437

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-04-18 09:42:19

    Call this method manually generate_password_hash

    It should be that the password data type passed in is wrong

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-18 09:42:19

    Str and Byte are different types in Python 3.

    password_byte = password.encode('utf') #然后传入这个变量

    reply
    0
  • Cancelreply