check.py 文件源码

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

项目:DjangoCMS 作者: farhan711 项目源码 文件源码
def deprecations(output):
    # deprecated placeholder_tags scan (1 in 3.1)
    templates_dirs = getattr(settings, 'TEMPLATES', [])[0]['DIRS']
    templates_dirs.extend(
        [os.path.join(path, 'templates') for path in get_app_paths()]
    )
    with output.section('Usage of deprecated placeholder_tags') as section:
        for template_dir in templates_dirs:
            for tokens, path in _load_all_templates(template_dir):
                for token in tokens:
                    if token.token_type == TOKEN_BLOCK:
                        bits = token.split_contents()
                        if bits[0] == 'load' and 'placeholder_tags' in bits:
                            section.warn(
                                'Usage of deprecated template tag library '
                                'placeholder tags in template %s' % path
                            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号