__init__.py 文件源码

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

项目:crm 作者: Incubaid 项目源码 文件源码
def register_template_dirs(self):
        """
        Go Through all sub applications under (crm) and if a dir called (templates)
        found, register it as a template directory
        """
        template_dirs = []
        for root, dirs, _ in os.walk('crm'):
            for dir in dirs:
                if not dir == 'templates':
                    continue
                template_dirs.append(os.path.abspath(os.path.join(root, dir)))
        template_loader = jinja2.ChoiceLoader([
            self._app.jinja_loader,
            jinja2.FileSystemLoader(template_dirs),
        ]
        )
        self._app.jinja_loader = template_loader
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号