loader.py 文件源码

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

项目:PyPlanet 作者: PyPlanet 项目源码 文件源码
def get_mapping(cls):
        from pyplanet.core import Controller

        mapping = dict()

        # Static core components.
        mapping['core.views'] = PackageLoader('pyplanet.views', 'templates')

        # Add app prefixes.
        for app_label, app in Controller.instance.apps.apps.items():
            template_path = os.path.join(app.path, 'templates')
            if os.path.exists(template_path):
                mapping[app_label] = FileSystemLoader(template_path)

        return mapping
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号