from flask import Flask,render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('base,html')
@app.route('/login/')
def login():
return render_template('login.html')
@app.route('/register/')
def register():
return render_template('register.html')
if __name__ == '__main__':
app.run(debug=True)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>游民星空账号登录</title>
<link rel="stylesheet" type="text/css" href="login.css">
<script src="login.js"></script>
</head>
<body>
<div class="bigbox">
<div class="box">
<h2>♛游民星空账号登录♛</h2>
<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="register.css">
<script src="login.js.js"></script>
</head>
<body>
<div class="bigbox">
<div class="box">
<h2>♛游民星空账号注册♛</h2>
<div class="input_box">
输入账号:<input id="umane"type="text"placeholder="请输入账号">
</div>
<div class="input_box">
输入密码:<input id="upass"type="password"placeholder="请输入密码">
</div>
<div class="input_box">
再输密码:<input id="userpass1" type="password" placeholder="请再次输入密码">
</div>
<div id="error_box"><br></div>
<div class="input_box">
<h5><input type="radio" value="我已阅读相关条例">我已阅读相关条例</h5>. <br>
<button onclick="myLogin()">注册</button>
<button onclick="myLogin()">取消</button>
</div>
</div>
</body>
</html>