assets.py 文件源码

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

项目:djaio 作者: Sberned 项目源码 文件源码
def __init__(self, app):
        self.app = app
        env = get_env(app)

        if env is None:
            text = ("Template engine is not initialized, "
                    "call aiohttp_jinja2.setup(...) first"
                    "")
            # in order to see meaningful exception message both: on console
            # output and rendered page we add same message to *reason* and
            # *text* arguments.
            raise web.HTTPInternalServerError(reason=text, text=text)

        self._set_asset_paths(app)

        # We only want to refresh the webpack stats in development mode,
        # not everyone sets this setting, so let's assume it's production.
        if app.settings.DEBUG:
            app.on_response_prepare.append(self._refresh_webpack_stats)

        env.globals['asset_url_for'] = self.asset_url_for
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号