• 开始Flask项目


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>base</title>
        <link rel="stylesheet" href="../static/css/base.css" type="text/css">
        <script src="../static/js/base.js"></script>
    
    </head>
    <body id="myBody">
    <nav>
    
        <img id="myOnOff" onclick="mySwitch()"
             src="http://pic.58pic.com/58pic/12/38/64/52Y58PICFWV.jpg" width="100"height="50">
        <a href="http://www.narutom.com/video/">首页</a>
        <input type="text">
        <button>查找</button>
        <button><a href="{{ url_for('login') }}">登陆</a></button>
    </nav>
    <div class="area">
    
    </div>
    
    
    <div class="area1">
        <div class="img">
            <a href="https://baike.baidu.com/item/%E6%BC%A9%E6%B6%A1%E9%B8%A3%E4%BA%BA/322717?fr=aladdin"><img
                    src="http://img3.imgtn.bdimg.com/it/u=1024789900,1375050730&fm=214&gp=0.jpg"></a>
            <div class="desc"><a href="https://baike.baidu.com/item/%E6%BC%A9%E6%B6%A1%E9%B8%A3%E4%BA%BA/322717?fr=aladdin">漩涡鸣人</a></div>
        </div>
        <div class="img">
            <a href="https://baike.baidu.com/item/%E5%AE%87%E6%99%BA%E6%B3%A2%E4%BD%90%E5%8A%A9">
                <img src="http://dl.bizhi.sogou.com/images/2012/04/17/232306.jpg"></a>
            <div class="desc"><a href="https://baike.baidu.com/item/%E5%AE%87%E6%99%BA%E6%B3%A2%E4%BD%90%E5%8A%A9">宇智波佐助</a></div>
        </div>
        <div class="img">
            <a href="https://baike.baidu.com/item/%E8%87%AA%E6%9D%A5%E4%B9%9F/7041?fr=aladdin">
                <img src="http://img3.imgtn.bdimg.com/it/u=3803389959,1787876432&fm=214&gp=0.jpg"></a>
            <div class="desc"><a href="https://baike.baidu.com/item/%E8%87%AA%E6%9D%A5%E4%B9%9F/7041?fr=aladdin">自来也</a>
            </div>
        </div>
    </div>
    
    <br>
    <br>
    
    </body>
    </html>
    

      

    from flask import Flask,render_template
    
    app = Flask(__name__)
    
    
    @app.route('/')
    def index():
        return render_template('test.html')
    
    @app.route('/login')
    def login():
        return render_template('login.html')
    
    
    
    if __name__ == '__main__':
        app.run(debug=True)
    

      

  • 相关阅读:
    C# 操作txt
    下周学习计划(0815——0822)
    配置允许外界访问的端口
    修改表结构
    C# return和break
    js Ajax的几种操作方法
    WebForm
    Extjs4新特性
    25、手把手教你Extjs5(二十五)Extjs5常用组件--form的基本用法
    24、手把手教你Extjs5(二十四)模块Form的自定义的设计[3]
  • 原文地址:https://www.cnblogs.com/Sun584125503/p/7776748.html
Copyright © 2020-2023  润新知