我们提供消息推送系统招投标所需全套资料,包括消息推送系统介绍PPT、消息推送系统产品解决方案、
消息推送系统产品技术参数,以及对应的标书参考文件,详请联系客服。
from flask import Flask, request
from flask_httpauth import HTTPBasicAuth
from werkzeug.security import generate_password_hash, check_password_hash
app = Flask(__name__)
auth = HTTPBasicAuth()
users = {
"alice": generate_password_hash("secret"),
"bob": generate_password_hash("password")
}
@auth.verify_password
def verify_password(username, password):
if username in users and \
check_password_hash(users.get(username), password):
return username
@app.route('/')
@auth.login_required
def index():
return f"Hello, {auth.current_user()}!"
if __name__ == '__main__':
app.run(ssl_context='adhoc')
]]>