推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
hihihihihi
V2EX  ›  Python

bootstrap admin theme 配合 flask 的正确打开方式是什么?

  •  
  •   hihihihihi · Aug 9, 2018 via iPhone · 2151 views
    This topic created in 2968 days ago, the information mentioned may be changed or developed.
    对 web 不熟,需要做一个简单好看的后台信息展示小工具,找了几个好看的模版,目前我的方式是:

    1. 先在购买的 theme 的基础上搭建一个范例文件,组合出我需要的一些 ui 元素和页面布局

    2. 因为会有很多用不到的 js 和 css,这一步需要一条一条删除然后刷新页面看是否有影响,然后最终保存一个相对简洁的文件。

    3. 拷贝到 flask 中做模版,又需要修改资源路径,js css 等


    4.jinja 替换 ui 元素信息为我要的信息


    赶觉这样操作好浪费时间。



    所以,我的问题是:
    1. 是不是我这种使用 bootstrap admin theme 结合 flask 的方式不对?

    2. 有没有方法针对某一个页面,仅仅只另存为用到加载到的资源。比如随便一个 bootstrap theme 里面就有大量图片和 js font 都用不到,能怎么保存一个精简版?

    听说 react 做 ui 爽,我简单看了下,学习起来要费时间,我目前主要只是要一个好看的 admin 加上一些 ajaxj 动态刷新就足够。
    2 replies  •  2018-08-09 10:25:21 +08:00
    hiwljun
        1
    hiwljun  
       Aug 9, 2018
    adminlte 了解一下。

    <!-- Tell the browser to be responsive to screen width -->
    <link rel="stylesheet" href="{{ url_for('static', filename='plugins/bootstrap/css/bootstrap.min.css') }}">

    <!-- Font Awesome -->
    <link rel="stylesheet" href="{{ url_for('static', filename='plugins/font-awesome/css/font-awesome.min.css') }}">

    <!-- Ionicons -->
    <link rel="stylesheet" href="{{ url_for('static', filename='plugins/Ionicons/css/ionicons.min.css') }}">

    <!-- Theme style -->
    <link rel="stylesheet" href="{{ url_for('static', filename='css/AdminLTE.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/skin-blue.min.css') }}">

    <!-- jQuery 3 -->
    <script src="{{ url_for('static', filename='plugins/jquery/jquery.min.js') }}"></script>

    <!-- Bootstrap 3.3.7 -->
    <script src="{{ url_for('static', filename='plugins/bootstrap/js/bootstrap.min.js') }}"></script>

    <!-- AdminLTE App -->
    <script src="{{ url_for('static', filename='js/adminlte.min.js') }}"></script>
    scukmh
        2
    scukmh  
       Aug 9, 2018
    干嘛搞那么麻烦,nginx static 做一个,api 做一个,不要用 flask 的模板。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   950 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:10 · PVG 03:10 · LAX 12:10 · JFK 15:10
    ♥ Do have faith in what you're doing.