from flask import Flask,render_template
ap = Flask(__name__)
@ap.route('/')
def shouye():
return render_template('shouye.html')
@ap.route('/zhuce')
def zhuce():
return render_template('zhuce.html')
@ap.route('/denglu')
def denglu():
return render_template('denglu.html')
if __name__ == '__main__':
ap.run(debug='True')
from flask import Flask,render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/login/')
def login():
return render_template('login.html')
@app.route('/zhuce/')
def zhuce():
return render_template('zhuce.html')
if __name__ == '__main__':
app.run(debug=True)
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>首页</title>
</head>
<body>
<a href="http://127.0.0.1:5000/">首页</a>
<a href="http://127.0.0.1:5000/login/">登录</a>
<a href="http://127.0.0.1:5000/zhuce/">注册</a>
<h1>首页</h1>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="../static/css/aa.css">
<script src="../static/js/aa.js"></script>
</head>
<body>
<div class="Outbox">
<div class="box">
<h2>Welcome to GZCC!</h2>
<h3>登录页面</h3>
<div class="input_box">
账号:<input id="umane"type="text"placeholder="请输入账号">
</div>
<div class="input_box">
密码:<input id="upass"type="password"placeholder="请输入密码">
</div>
<div id="error_box"><br></div>
<div class="input_box">
<button onclick="myLogin()">登录</button>
<button onclick=window.alert("请重新输入")>取消</button></div>
</div>
</div>
</body>
</html>
复制代码
复制代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>界面</title>
<link rel="stylesheet" type="text/css" href="../static/css/aa.css">
<script src="../static/js/aa.js"></script>
</head> <div class="div1"> <div class="div2">注册</div>
<div class="div3"> 请输入你的昵称:<input id="username" type="text" placeholder="请输入你的昵称"> </div>
<div class="div3"> 设置密码:<input id="userpass" type="text" placeholder="请输入密码"> </div>
<div class="div3"> 重复密码:<input id="userpass1" type="text" placeholder="请再次输入密码"> </div>
<div id="error_box"><br></div> <div class="div3"> <button onclick="myLogin()">注册</button>
</div>
</div>
<br>
</body>
</html>