马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
from flask import Flask
app = Flask(__name__)
passwd = {"qiuyouzhi": '123456'}
@app.route('/')
def index():
return "<h1> HELLO! THIS IS MY WEBSITE, PLEASE GOTO /login AND LOGIN!"
@app.route('/login/<username> <password>')
def login(username, password):
if username in passwd:
if passwd[username] == password:
return "<h1> WELCOME BACK, %s ! </h1>" % username
return "<h1> OH NO, PASSWORD IS WRONG!"
return "<h1> NO THIS USER NAME %s !</h1>" % username
if __name__ == "__main__":
app.run()
|