auth.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:quokka_ng 作者: rochacbruno 项目源码 文件源码
def create_user(**data):
    if 'username' not in data or 'password' not in data:
        raise ValueError('username and password are required.')

    data['_id'] = data['username']
    data['password'] = generate_password_hash(
        data.pop('password'),
        method='pbkdf2:sha256'
    )
    # current_app.db.users.insert_one(data)
    current_app.db.insert('users', data)
    return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号