管理信息系统的开发与管理

from flask import Flask,render_template

app = Flask(__name__)


@app.route('/')
def daohang():
    return render_template('daohang.html')
@app.route('/login/')
def login():
    return render_template('1031.html')
@app.route('/regist/')
def regist():
    return render_template('regist.html')
@app.route('/biaoqian/')
def biaoqian():
    return render_template('biaoqian.html')
if __name__ == '__main__':
    app.run(debug=True)

  

{% extends'daohang.html' %}
{% block title %}发布问答{% endblock %}
{% block head %}
    <link rel="stylesheet" href="{{ url_for('static',filename='css/1031.css') }}" type="text/css">
{% endblock %}

{% block main %}
    <div class="box" >
    <h2>发布问答</h2>
    <div class="form-group">
        <lable for="title">标题</lable>
        <br>
        <textarea class="form-control" id="title" rows="1"></textarea>
    </div>
    <div class="form-group">
        <lable for="title">详情</lable>
        <br>
        <textarea class="form-control" id="questionDetail" rows="5"></textarea>
    </div>
    <input type="checkbox">Check me out<br>
        <button >发布问答</button>
    </div>
{% endblock %}

  

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}首页</title>
    <link type="text/css" rel="stylesheet" href="{{ url_for('static',filename='/css/index.css') }}">
    <script src="{{ url_for('static',filename='js/moonlight.js') }}"></script>
    {% block head %}{% endblock %}
</head>
<body id="myBody">
<nav>
    <img src="http://cdn2.jianshu.io/assets/web/logo-58fd04f6f0de908401aa561cda6a0688.png" width="40px">
    <a href="{{ url_for('daohang') }}">首页</a>
    <a href="http://www.jianshu.com/">下载app</a>
    <input type="text" name="search">
    <button type="submit">搜索</button>
    <a href="{{ url_for('login') }}">登陆</a>
    <a href="{{ url_for('regist') }}">注册</a>
    <a href="{{ url_for('biaoqian') }}">发布问答</a>
    <img id="myOnOff" src="http://www.runoob.com/images/pic_bulbon.gif" onclick="mySwitch()" width="20px">
</nav>
{% block main %}{% endblock %}
</body>
</html>

  

posted @ 2017-11-08 20:29  002邓诺斯  阅读(116)  评论(0编辑  收藏  举报