标签:form template run 设置 input 使用 确认密码 css 完成
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(‘/regist/‘) def regist(): return render_template(‘regist.html‘) if __name__ == ‘__main__‘: app.run(debug=True)
<!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="{{ url_for(‘regist‘) }}">注册</a> <h1>首页</h1> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>登录</title> <link href="../static/css/denglu.css" rel="stylesheet" type="text/css"> <script src="../static/js/denglu.js"></script> </head> <body> <form method="post" action="index.html"> <div class="box"> <h1>用户登录</h1> <div class="input_box1"> <input id="uname" type="text" placeholder="请输入用户名"> </div> <div class="input_box2"> <input id="upass" type="password" placeholder="请输入密码"> </div> <div id="error_box"><br></div> <div class="input_box"> <button onclick="fnlogin()">登录</button> </div> </div> </form> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>注册</title> <link href="../static/css/denglu.css" rel="stylesheet" type="text/css"> <script src="../static/js/denglu.js"></script> </head> <body> <form method="post" action="index.html"> <div class="box"> <h1>注册</h1> <div class="input_box1"> <input id="uname" type="text" placeholder="请输入用户名"> </div> <div class="input_box2"> <input id="upass" type="password" placeholder="请输入密码"> <input id="upass1" type="password" placeholder="请确认密码"> </div> <div id="error_box"><br></div> <div class="input_box"> <button onclick="fnlogin()">登录</button> </div> </div> </form> </body> </html>
标签:form template run 设置 input 使用 确认密码 css 完成
原文地址:http://www.cnblogs.com/892356821qqcom/p/7780295.html