bootstrap.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:flask-maple 作者: honmaple 项目源码 文件源码
def assets(self, app):
        bundles = {
            'home_js': Bundle(
                'bootstrap/js/jquery.min.js',
                'bootstrap/bootstrap/js/bootstrap.min.js',
                output='assets/home.js',
                filters='jsmin'),
            'home_css': Bundle(
                'bootstrap/bootstrap/css/bootstrap.min.css',
                'bootstrap/css/honmaple.css',
                output='assets/home.css',
                filters='cssmin')
        }
        if self.use_auth:
            auth_js = ('bootstrap/js/honmaple.js', 'bootstrap/js/login.js')
            bundles['home_js'].contents = bundles['home_js'].contents + auth_js
        if self.css:
            bundles['home_css'].contents = bundles[
                'home_css'].contents + self.css
        if self.js:
            bundles['home_js'].contents = bundles['home_js'].contents + self.js

        assets = Environment(app)
        assets.register(bundles)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号