Exemple #1
0
def deprecations(output):
    # deprecated placeholder_tags scan (1 in 3.1)
    templates_dirs = list(getattr(settings, 'TEMPLATE_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)
Exemple #2
0
def deprecations(output):
    # deprecated placeholder_tags scan (1 in 3.1)
    templates_dirs = list(getattr(settings, 'TEMPLATE_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
                            )