第一次提交
This commit is contained in:
20
generate_password_hash.py
Normal file
20
generate_password_hash.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
生成正确的密码哈希值
|
||||
用于修复init_mysql.sql中的密码哈希
|
||||
"""
|
||||
|
||||
from werkzeug.security import generate_password_hash
|
||||
|
||||
def generate_admin_password_hash():
|
||||
# 生成admin/admin123的密码哈希
|
||||
password = "admin123"
|
||||
password_hash = generate_password_hash(password, method='pbkdf2:sha256')
|
||||
print(f"用户名: admin")
|
||||
print(f"密码: {password}")
|
||||
print(f"密码哈希: {password_hash}")
|
||||
return password_hash
|
||||
|
||||
if __name__ == "__main__":
|
||||
generate_admin_password_hash()
|
||||
Reference in New Issue
Block a user