def render_custom_content(body, context_data={}):
 lexer = Lexer(body, origin=None)
 parser = CustomPayloadParser(lexer.tokenize())
 nodes = parser.parse()
 return nodes.render(Context(context_data))

def render_custom_content ( body , context_data = { } ) : lexer = Lexer ( body , origin = None ) parser = CustomPayloadParser ( lexer . tokenize ( ) ) nodes = parser . parse ( ) return nodes . render ( Context ( context_data ) )
renders custom content for the payload using django templating .