from flask import Flask,render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route("/login/",methods=['GET','POST'])
def login():
return render_template('login.html')
@app.route('/regist/')
def regist():
return render_template('regist.html')
if __name__ == '__main__':
app.run()
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<title>{% block title %}{% endblock %}
首页</title>
<link type="text/css" rel="stylesheet" href="{{ url_for('static',filename='css/index.css')}}">
</head>
<body>
<nav>
<img src="../static/image/1.jpg" alt="wo" width="30">
<a href="{{ url_for('index') }}">首页</a>
<a href="http://127.0.0.1:5000/login"></a>
<a href="{{ url_for('regist') }}">注册</a>
<a href="{{ url_for('login') }}">登录</a>
<img src="{{ url_for('static',filename='image/1.jpg')}}" alt="" width="30px">
</nav>
{% block main%}{% endblock %}
<div class="area">
</div>
<footer>
<div class="footer_box">
Write@2017byBeryl </div>
</footer>
</body>
</html>