Here is the relevant template tag and html:
from django import template
from django.conf import settings
register = template.Library()
@register.inclusion_tag('auth_backend/templatetags/extends_layout.html')
def extends_layout():
layout_template = getattr(settings, 'AUTHBACKEND_LAYOUT_TEMPLATE', '')
return {'layout': layout_template}
{% if layout %}
{% extends layout %} <<<<<<<<<<<<< Problem here
{% endif %}
When I use it in a view, I get the following error:
{# Sample view #}
{% load auth_backend_tags %}
{% load staticfiles %}
{% extends_layout %}
Django: Invalid block tag: 'endif'
If I delete {% extends layout %} then the error goes away, except my template tag is now blank.
What am I doing wrong?