利用Python实现医疗系统事务管理 - 1:5000/admin123456/dashboard
要实现医疗系统事务管理,可以使用Python的Flask框架创建一个Web应用。以下是一个简单的示例: 拼多多帮助力入口
首先,安装Flask库:
pip install Flask
app.py
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
username = request.form['username']
password = request.form['password']
if username == 'admin' and password == '123456':
return redirect(url_for('dashboard'))
else:
return "用户名或密码错误"
return render_template('login.html')
@app.route('/dashboard')
def dashboard():
return "欢迎来到医疗系统!"
if __name__ == '__main__':
app.run(debug=True)
templatesindex.htmllogin.html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>医疗系统</title>
</head>
<body>
<h1>欢迎来到医疗系统!</h1>
<a href="/login">登录</a>
</body>
</html>
login.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录</title>
</head>
<body>
<h1>请输入用户名和密码进行登录</h1>
<form action="/login" method="post">
<label for="username">用户名:</label>
<input type="text" id="username" name="username" required><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password" required><br>
<input type="submit" value="登录">
</form>
</body>
</html>
app.py
python app.py
http://127.0.0.1:5000/admin123456/dashboard,利用Python实现医疗系统事务管理