Created
May 1, 2014 13:39
-
-
Save agamdua/178c6fb5c01d3105b0c9 to your computer and use it in GitHub Desktop.
From django.templates.base
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compile_string(template_string, origin): | |
"Compiles template_string into NodeList ready for rendering" | |
if settings.TEMPLATE_DEBUG: | |
from django.template.debug import DebugLexer, DebugParser | |
lexer_class, parser_class = DebugLexer, DebugParser | |
else: | |
lexer_class, parser_class = Lexer, Parser | |
lexer = lexer_class(template_string, origin) | |
parser = parser_class(lexer.tokenize()) | |
return parser.parse() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment