Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Django ticket 20745 Rendering foo.html raises a TypeError whereas bar.html doesn't.

View bar.html
1 2 3 4 5
{% extends 'foo.html' %}
 
{% block foo %}
{{ block.super }}
{% endblock %}
View bar.html
1 2 3 4 5
{% load raise %}
 
{% block foo %}
{% raise 'TypeError' %}
{% endblock %}
View bar.html
1 2 3 4 5 6 7 8 9 10
import builtins
from django import template
 
register = template.Library()
 
@register.simple_tag(name='raise')
def do_raise(exception_name, msg=None):
exception_type = getattr(builtins, exception_name)
args = (msg,) if msg is not None else ()
raise exception_type(*args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.