Skip to content
Create a gist now

Instantly share code, notes, and snippets.

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()
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.