Skip to content

Instantly share code, notes, and snippets.

@chapkovski
Created August 10, 2018 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chapkovski/5c7c34667882c3a159cfdc0aa515a4a2 to your computer and use it in GitHub Desktop.
Save chapkovski/5c7c34667882c3a159cfdc0aa515a4a2 to your computer and use it in GitHub Desktop.
copypaste from django extends tag
@register.tag('extends')
def do_extends(parser, token):
...
nodelist = parser.parse()
if nodelist.get_nodes_by_type(ExtendsNode):
raise TemplateSyntaxError("'%s' cannot appear more than once in the same template" % bits[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment