(parser, token)
return loader_tags.BlockNode("__" + tag_name, NodeList([
        RequireJSMainNode(tag_name, value and value[1:-1])
    ]))
Indicate that a page should be using RequireJS, by naming the
    JavaScript module to be used as the page's main entry point.

    The base template must have a `{% requirejs_main ... %}` tag before
    the `requirejs_main` variable is accessed anywhere in the template.
    The base template need not specify a value in its `{% requirejs_main %}`
    tag, allowing it to be extended by templates that may or may not
    use requirejs. In this case the `requirejs_main` template variable
    will have a value of `None` unless an extending template has a
    `{% requirejs_main "..." %}` with a value.
Indicate that a page should be using RequireJS, by naming the
    JavaScript module to be used as the page's main entry point.
Indicate that a page should be using RequireJS by naming the JavaScript module to be used as the page s main entry point .
def requirejs_main(parser, token):
    """
    Indicate that a page should be using RequireJS, by naming the
    JavaScript module to be used as the page's main entry point.

    The base template must have a `{% requirejs_main ... %}` tag before
    the `requirejs_main` variable is accessed anywhere in the template.
    The base template need not specify a value in its `{% requirejs_main %}`
    tag, allowing it to be extended by templates that may or may not
    use requirejs. In this case the `requirejs_main` template variable
    will have a value of `None` unless an extending template has a
    `{% requirejs_main "..." %}` with a value.
    """
    bits = token.contents.split(None, 1)
    if len(bits) == 1:
        tag_name = bits[0]
        value = None
    else:
        tag_name, value = bits
    if getattr(parser, "__saw_requirejs_main", False):
        raise TemplateSyntaxError(
            "multiple '%s' tags not allowed (%s)" % tuple(bits))
    parser.__saw_requirejs_main = True

    if value and (len(value) < 2 or value[0] not in '"\'' or value[0] != value[-1]):
        raise TemplateSyntaxError("bad '%s' argument: %s" % tuple(bits))

    # use a block to allow extension template to set requirejs_main for base
    return loader_tags.BlockNode("__" + tag_name, NodeList([
        RequireJSMainNode(tag_name, value and value[1:-1])
    ]))
def requirejs_main ( parser , token ) : bits = token . contents . split ( None , 1 ) if len ( bits ) == 1 : tag_name = bits [ 0 ] value = None else : tag_name , value = bits if getattr ( parser , "__saw_requirejs_main" , False ) : raise TemplateSyntaxError ( "multiple '%s' tags not allowed (%s)" % tuple ( bits ) ) parser . __saw_requirejs_main = True if value and ( len ( value ) < 2 or value [ 0 ] not in '"\'' or value [ 0 ] != value [ - 1 ] ) : raise TemplateSyntaxError ( "bad '%s' argument: %s" % tuple ( bits ) ) # use a block to allow extension template to set requirejs_main for base return loader_tags . BlockNode ( "__" + tag_name , NodeList ( [ RequireJSMainNode ( tag_name , value and value [ 1 : - 1 ] ) ] ) )