Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Django ticket 20745 Rendering foo.html raises a TypeError whereas bar.html doesn't.
{% extends 'foo.html' %}
{% block foo %}
{{ block.super }}
{% endblock %}
{% load raise %}
{% block foo %}
{% raise 'TypeError' %}
{% endblock %}
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.