maximum recursion depth exceeded
Request Method: | GET |
---|---|
Request URL: | http://www.vizelman.ru/sitemap/html/ |
Django Version: | 1.3 |
Exception Type: | RuntimeError |
Exception Value: | maximum recursion depth exceeded |
Exception Location: | /home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py in __init__, line 488 |
Python Executable: | /usr/bin/python |
Python Version: | 2.7.12 |
Python Path: | ['/home/users/v/vizelman/django', '/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg', '/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages', '/usr/lib/python27.zip', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages'] |
Server time: | Втр, 19 Мар 2024 12:03:15 +0300 |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/core/handlers/base.py
in get_response
raise ValueError("The view %s.%s didn't return an HttpResponse object." % (callback.__module__, view_name))
# If the response supports deferred rendering, apply template
# response middleware and the render the response
if hasattr(response, 'render') and callable(response.render):
for middleware_method in self._template_response_middleware:
response = middleware_method(request, response)
response.render()...
except http.Http404, e:
logger.warning('Not Found: %s' % request.path,
extra={
'status_code': 404,
'request': request
Variable | Value |
---|---|
exceptions | <module 'django.core.exceptions' from '/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/core/exceptions.pyc'> |
callback_args | () |
receivers | [(<function _rollback_on_exception at 0x7f5fa23d9b18>, None)] |
middleware_method | <bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7f5fa26b2290>> |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f5fa5055690> |
settings | <django.conf.LazySettings object at 0x7f5fa2be0310> |
request | <WSGIRequest GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{}, META:{'CSRF_COOKIE': '97f4f525121d02f9004488ec4618ab74', 'DOCUMENT_ROOT': '/home/users/v/vizelman/domains/vizelman.ru', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': '*/*', 'HTTP_CONNECTION': 'close', 'HTTP_HOST': 'www.vizelman.ru', 'HTTP_USER_AGENT': 'claudebot', 'HTTP_X_FORWARDED_FOR': '54.225.1.66', 'HTTP_X_FORWARDED_PROTO': 'http', 'HTTP_X_FORWARDED_PROTOCOL': 'http', 'HTTP_X_PROTOCOL': 'HTTP/1.1', 'HTTP_X_REAL_IP': '54.225.1.66', 'HTTP_X_SERVER_IP': '81.177.141.143', 'PATH_INFO': u'/sitemap/html/', 'PATH_TRANSLATED': 'redirect:/django.wsgi/sitemap/html//html/', 'QUERY_STRING': '', 'REDIRECT_STATUS': '200', 'REDIRECT_URL': '/sitemap/html/', 'REDIRECT_downgrade-1.0': '', 'REDIRECT_suppress-error-charset': '', 'REMOTE_ADDR': '54.225.1.66', 'REMOTE_PORT': '43836', 'REQUEST_METHOD': 'GET', 'REQUEST_URI': '/sitemap/html/', 'SCRIPT_FILENAME': '/home/users/v/vizelman/domains/vizelman.ru/django.wsgi', 'SCRIPT_NAME': u'', 'SERVER_ADDR': '81.177.141.143', 'SERVER_ADMIN': 'info@jino.ru', 'SERVER_NAME': 'www.vizelman.ru', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.0', 'SERVER_SIGNATURE': '', 'SERVER_SOFTWARE': 'Apache', 'downgrade-1.0': '', 'mod_wsgi.application_group': 'www.vizelman.ru|/django.wsgi', 'mod_wsgi.callable_object': 'application', 'mod_wsgi.handler_script': '', 'mod_wsgi.input_chunked': '0', 'mod_wsgi.listener_host': '', 'mod_wsgi.listener_port': '80', 'mod_wsgi.process_group': '', 'mod_wsgi.request_handler': 'wsgi-script', 'mod_wsgi.script_reloading': '1', 'mod_wsgi.version': (3, 2), 'suppress-error-charset': '', 'wsgi.errors': <mod_wsgi.Log object at 0x7f5fa5140e70>, 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f5fa26a66c0>, 'wsgi.input': <mod_wsgi.Input object at 0x7f5fa50bc830>, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 1)}> |
callback | <function TemplateView at 0x7f5fa127fed8> |
resolver | <RegexURLResolver main.urls (None:None) ^/> |
urlresolvers | <module 'django.core.urlresolvers' from '/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/core/urlresolvers.pyc'> |
callback_kwargs | {} |
response | <django.template.response.TemplateResponse object at 0x7f5fa128e190> |
urlconf | 'main.urls' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/response.py
in render
"""Render (thereby finalizing) the content of the response.
If the content has already been rendered, this is a no-op.
Returns the baked response instance.
"""
if not self._is_rendered:
self._set_content(self.rendered_content)...
for post_callback in self._post_render_callbacks:
post_callback(self)
return self
is_rendered = property(lambda self: self._is_rendered)
Variable | Value |
---|---|
self | <django.template.response.TemplateResponse object at 0x7f5fa128e190> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/response.py
in rendered_content
"""Returns the freshly rendered content for the template and context
described by the TemplateResponse.
This *does not* set the final content of the response. To set the
response content, you must either call render(), or set the
content explicitly using the value of this property.
"""
template = self.resolve_template(self.template_name)...
context = self.resolve_context(self.context_data)
content = template.render(context)
return content
def add_post_render_callback(self, callback):
"""Add a new post-rendering callback.
Variable | Value |
---|---|
self | <django.template.response.TemplateResponse object at 0x7f5fa128e190> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/response.py
in resolve_template
del obj_dict['_post_render_callbacks']
return obj_dict
def resolve_template(self, template):
"Accepts a template object, path-to-template or list of paths"
if isinstance(template, (list, tuple)):
return loader.select_template(template)...
elif isinstance(template, basestring):
return loader.get_template(template)
else:
return template
def resolve_context(self, context):
Variable | Value |
---|---|
self | <django.template.response.TemplateResponse object at 0x7f5fa128e190> |
template | ['sitemap.html'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in select_template
context_instance.pop()
def select_template(template_name_list):
"Given a list of template names, returns the first that can be loaded."
not_found = []
for template_name in template_name_list:
try:
return get_template(template_name)...
except TemplateDoesNotExist, e:
if e.args[0] not in not_found:
not_found.append(e.args[0])
continue
# If we get here, none of the templates could be loaded
raise TemplateDoesNotExist(', '.join(not_found))
Variable | Value |
---|---|
template_name | 'sitemap.html' |
not_found | [] |
template_name_list | ['sitemap.html'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | 'sitemap.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
loaders | [<django.template.loaders.filesystem.Loader object at 0x7f5fa128e310>, <django.template.loaders.app_directories.Loader object at 0x7f5fa128e3d0>] |
name | 'sitemap.html' |
loader_name | 'django.template.loaders.app_directories.Loader' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | 'sitemap.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa128e510> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap.html' |
template_name | 'sitemap.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'{% extends \'base/WhiteBase.html\' %}\n{% block include %}\n\t\t<link type="text/css" rel="stylesheet" href="/static/style/service.css"> \n{% endblock %}\n{% block h1 %}\u041a\u0430\u0440\u0442\u0430 \u0441\u0430\u0439\u0442\u0430{% endblock %}\n{% block content %}\t\n\t<div id="middle" class="cont">\n\t\t<div id="text"><ul>\n\t\t{% for cat in top_menu %}\n\t\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t\t{% endfor %}\n\t\t</ul></div>\n\t</div>\n{% endblock %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa128e510> |
source | u'{% extends \'base/WhiteBase.html\' %}\n{% block include %}\n\t\t<link type="text/css" rel="stylesheet" href="/static/style/service.css"> \n{% endblock %}\n{% block h1 %}\u041a\u0430\u0440\u0442\u0430 \u0441\u0430\u0439\u0442\u0430{% endblock %}\n{% block content %}\t\n\t<div id="middle" class="cont">\n\t\t<div id="text"><ul>\n\t\t{% for cat in top_menu %}\n\t\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t\t{% endfor %}\n\t\t</ul></div>\n\t</div>\n{% endblock %}' |
name | 'sitemap.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa128e510> |
template_string | u'{% extends \'base/WhiteBase.html\' %}\n{% block include %}\n\t\t<link type="text/css" rel="stylesheet" href="/static/style/service.css"> \n{% endblock %}\n{% block h1 %}\u041a\u0430\u0440\u0442\u0430 \u0441\u0430\u0439\u0442\u0430{% endblock %}\n{% block content %}\t\n\t<div id="middle" class="cont">\n\t\t<div id="text"><ul>\n\t\t{% for cat in top_menu %}\n\t\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t\t{% endfor %}\n\t\t</ul></div>\n\t</div>\n{% endblock %}' |
self | <django.template.base.Template object at 0x7f5fa128e550> |
name | 'sitemap.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa128e510> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa128e9d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa128ea10> |
template_string | u'{% extends \'base/WhiteBase.html\' %}\n{% block include %}\n\t\t<link type="text/css" rel="stylesheet" href="/static/style/service.css"> \n{% endblock %}\n{% block h1 %}\u041a\u0430\u0440\u0442\u0430 \u0441\u0430\u0439\u0442\u0430{% endblock %}\n{% block content %}\t\n\t<div id="middle" class="cont">\n\t\t<div id="text"><ul>\n\t\t{% for cat in top_menu %}\n\t\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t\t{% endfor %}\n\t\t</ul></div>\n\t</div>\n{% endblock %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [] |
self | <django.template.debug.DebugParser object at 0x7f5fa128ea10> |
token | <django.template.base.Token object at 0x7f5fa128e890> |
parse_until | [] |
command | u'extends' |
compile_func | <function do_extends at 0x7f5fa137e8c0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_extends
if len(bits) != 2:
raise TemplateSyntaxError("'%s' takes one argument" % bits[0])
parent_name, parent_name_expr = None, None
if bits[1][0] in ('"', "'") and bits[1][-1] == bits[1][0]:
parent_name = bits[1][1:-1]
else:
parent_name_expr = parser.compile_filter(bits[1])
nodelist = parser.parse()...
if nodelist.get_nodes_by_type(ExtendsNode):
raise TemplateSyntaxError("'%s' cannot appear more than once in the same template" % bits[0])
return ExtendsNode(nodelist, parent_name, parent_name_expr)
def do_include(parser, token):
"""
Variable | Value |
---|---|
parent_name_expr | None |
parent_name | u'base/WhiteBase.html' |
token | <django.template.base.Token object at 0x7f5fa128e890> |
parser | <django.template.debug.DebugParser object at 0x7f5fa128ea10> |
bits | [u'extends', u"'base/WhiteBase.html'"] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
compiled_result | <Block Node: h1. Contents: [<Text Node: '????? ?????'>]> |
nodelist | [<Text Node: ' '>, <Block Node: include. Contents: [<Text Node: ' <link type="text/css" '>]>, <Text Node: ' '>, <Block Node: h1. Contents: [<Text Node: '????? ?????'>]>, <Text Node: ' '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa128ea10> |
token | <django.template.base.Token object at 0x7f5fa128ee10> |
parse_until | [] |
command | u'block' |
compile_func | <function do_block at 0x7f5fa1375ed8> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_block
# check for duplication.
try:
if block_name in parser.__loaded_blocks:
raise TemplateSyntaxError("'%s' tag with name '%s' appears more than once" % (bits[0], block_name))
parser.__loaded_blocks.append(block_name)
except AttributeError: # parser.__loaded_blocks isn't a list yet
parser.__loaded_blocks = [block_name]
nodelist = parser.parse(('endblock', 'endblock %s' % block_name))...
parser.delete_first_token()
return BlockNode(block_name, nodelist)
def do_extends(parser, token):
"""
Signal that this template extends a parent template.
Variable | Value |
---|---|
block_name | u'content' |
token | <django.template.base.Token object at 0x7f5fa128ee10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa128ea10> |
bits | [u'block', u'content'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <div id="middle" class'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa128ea10> |
token | <django.template.base.Token object at 0x7f5fa128ee90> |
parse_until | ('endblock', u'endblock content') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa128ee50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa128ea10> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa128ee90> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'top_menu'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa128ea10> |
token | <django.template.base.Token object at 0x7f5fa128ef10> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa128ea10> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa128eed0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa128ef10> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa128eed0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa128eed0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa129c0d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa128eed0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa129c190> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa129c190> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa129c190> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa129c1d0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa129c190> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa129c210> |
parser | <django.template.debug.DebugParser object at 0x7f5fa129c250> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa129c310> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa129c3d0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa129c250> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa129c7d0>) |
token | <django.template.base.Token object at 0x7f5fa129c3d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa129c250> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa129c250> |
token | <django.template.base.Token object at 0x7f5fa129c450> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa129c410> |
parser | <django.template.debug.DebugParser object at 0x7f5fa129c250> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa129c450> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa129c250> |
token | <django.template.base.Token object at 0x7f5fa129c4d0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa129c250> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa129c490>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa129c4d0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa129c490>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa129c490>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa129c9d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa129c490>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa129ca90> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa129ca90> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa129ca90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa129cad0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa129ca90> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa129cb10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa129cb50> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa129cc10> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa129ccd0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa129cb50> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa122d090>) |
token | <django.template.base.Token object at 0x7f5fa129ccd0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa129cb50> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa129cb50> |
token | <django.template.base.Token object at 0x7f5fa129cd50> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa129cd10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa129cb50> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa129cd50> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa129cb50> |
token | <django.template.base.Token object at 0x7f5fa129cdd0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa129cb50> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa129cd90>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa129cdd0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa129cd90>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa129cd90>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa122d290> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa129cd90>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa122d350> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa122d350> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa122d350> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa122d390> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa122d350> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa122d3d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa122d410> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa122d4d0> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa122d590> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa122d410> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa122d910>) |
token | <django.template.base.Token object at 0x7f5fa122d590> |
parser | <django.template.debug.DebugParser object at 0x7f5fa122d410> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa122d410> |
token | <django.template.base.Token object at 0x7f5fa122d610> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa122d5d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa122d410> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa122d610> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa122d410> |
token | <django.template.base.Token object at 0x7f5fa122d690> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa122d410> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa122d650>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa122d690> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa122d650>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa122d650>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa122db10> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa122d650>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa122dbd0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa122dbd0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa122dbd0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa122dc10> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa122dbd0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa122dc50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa122dc90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa122dd50> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa122de10> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa122dc90> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa12381d0>) |
token | <django.template.base.Token object at 0x7f5fa122de10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa122dc90> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa122dc90> |
token | <django.template.base.Token object at 0x7f5fa122de90> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa122de50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa122dc90> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa122de90> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa122dc90> |
token | <django.template.base.Token object at 0x7f5fa122df10> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa122dc90> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa122ded0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa122df10> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa122ded0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa122ded0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa12383d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa122ded0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1238490> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1238490> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1238490> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa12384d0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1238490> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1238510> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1238550> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1238610> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa12386d0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1238550> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1238a50>) |
token | <django.template.base.Token object at 0x7f5fa12386d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1238550> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1238550> |
token | <django.template.base.Token object at 0x7f5fa1238750> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1238710> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1238550> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1238750> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1238550> |
token | <django.template.base.Token object at 0x7f5fa12387d0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1238550> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1238790>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa12387d0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1238790>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1238790>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1238c50> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1238790>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1238d10> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1238d10> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1238d10> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1238d50> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1238d10> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1238d90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1238dd0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1238e90> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1238f50> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1238dd0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1242310>) |
token | <django.template.base.Token object at 0x7f5fa1238f50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1238dd0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1238dd0> |
token | <django.template.base.Token object at 0x7f5fa1238fd0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1238f90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1238dd0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1238fd0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1238dd0> |
token | <django.template.base.Token object at 0x7f5fa1242090> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1238dd0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1242050>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1242090> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1242050>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1242050>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1242510> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1242050>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa12425d0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa12425d0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa12425d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1242610> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa12425d0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1242650> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1242690> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1242750> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1242810> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1242690> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1242b90>) |
token | <django.template.base.Token object at 0x7f5fa1242810> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1242690> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1242690> |
token | <django.template.base.Token object at 0x7f5fa1242890> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1242850> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1242690> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1242890> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1242690> |
token | <django.template.base.Token object at 0x7f5fa1242910> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1242690> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12428d0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1242910> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12428d0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12428d0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1242d90> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12428d0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1242e50> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1242e50> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1242e50> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1242e90> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1242e50> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1242ed0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1242f10> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1242fd0> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa124c0d0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1242f10> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa124c450>) |
token | <django.template.base.Token object at 0x7f5fa124c0d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1242f10> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1242f10> |
token | <django.template.base.Token object at 0x7f5fa124c150> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa124c110> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1242f10> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa124c150> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1242f10> |
token | <django.template.base.Token object at 0x7f5fa124c1d0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1242f10> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa124c190>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa124c1d0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa124c190>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa124c190>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa124c650> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa124c190>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa124c710> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa124c710> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa124c710> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa124c750> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa124c710> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa124c790> |
parser | <django.template.debug.DebugParser object at 0x7f5fa124c7d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa124c890> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa124c950> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa124c7d0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa124ccd0>) |
token | <django.template.base.Token object at 0x7f5fa124c950> |
parser | <django.template.debug.DebugParser object at 0x7f5fa124c7d0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa124c7d0> |
token | <django.template.base.Token object at 0x7f5fa124c9d0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa124c990> |
parser | <django.template.debug.DebugParser object at 0x7f5fa124c7d0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa124c9d0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa124c7d0> |
token | <django.template.base.Token object at 0x7f5fa124ca50> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa124c7d0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa124ca10>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa124ca50> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa124ca10>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa124ca10>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa124ced0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa124ca10>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa124cf90> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa124cf90> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa124cf90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa124cfd0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa124cf90> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1259050> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1259090> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1259150> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1259210> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1259090> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1259590>) |
token | <django.template.base.Token object at 0x7f5fa1259210> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1259090> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1259090> |
token | <django.template.base.Token object at 0x7f5fa1259290> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1259250> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1259090> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1259290> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1259090> |
token | <django.template.base.Token object at 0x7f5fa1259310> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1259090> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12592d0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1259310> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12592d0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12592d0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1259790> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12592d0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1259850> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1259850> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1259850> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1259890> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1259850> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa12598d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1259910> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa12599d0> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1259a90> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1259910> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1259e10>) |
token | <django.template.base.Token object at 0x7f5fa1259a90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1259910> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1259910> |
token | <django.template.base.Token object at 0x7f5fa1259b10> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1259ad0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1259910> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1259b10> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1259910> |
token | <django.template.base.Token object at 0x7f5fa1259b90> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1259910> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1259b50>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1259b90> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1259b50>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1259b50>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11e6050> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1259b50>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11e6110> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11e6110> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11e6110> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11e6150> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11e6110> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11e6190> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11e61d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11e6290> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11e6350> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11e61d0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11e66d0>) |
token | <django.template.base.Token object at 0x7f5fa11e6350> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11e61d0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11e61d0> |
token | <django.template.base.Token object at 0x7f5fa11e63d0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11e6390> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11e61d0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11e63d0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11e61d0> |
token | <django.template.base.Token object at 0x7f5fa11e6450> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11e61d0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11e6410>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11e6450> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11e6410>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11e6410>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11e68d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11e6410>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11e6990> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11e6990> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11e6990> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11e69d0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11e6990> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11e6a10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11e6a50> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11e6b10> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11e6bd0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11e6a50> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11e6f50>) |
token | <django.template.base.Token object at 0x7f5fa11e6bd0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11e6a50> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11e6a50> |
token | <django.template.base.Token object at 0x7f5fa11e6c50> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11e6c10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11e6a50> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11e6c50> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11e6a50> |
token | <django.template.base.Token object at 0x7f5fa11e6cd0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11e6a50> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11e6c90>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11e6cd0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11e6c90>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11e6c90>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11ef190> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11e6c90>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11ef250> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11ef250> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11ef250> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11ef290> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11ef250> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11ef2d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11ef310> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11ef3d0> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11ef490> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11ef310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11ef810>) |
token | <django.template.base.Token object at 0x7f5fa11ef490> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11ef310> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11ef310> |
token | <django.template.base.Token object at 0x7f5fa11ef510> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11ef4d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11ef310> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11ef510> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11ef310> |
token | <django.template.base.Token object at 0x7f5fa11ef590> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11ef310> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11ef550>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11ef590> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11ef550>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11ef550>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11efa10> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11ef550>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11efad0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11efad0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11efad0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11efb10> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11efad0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11efb50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11efb90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11efc50> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11efd10> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11efb90> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11f80d0>) |
token | <django.template.base.Token object at 0x7f5fa11efd10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11efb90> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11efb90> |
token | <django.template.base.Token object at 0x7f5fa11efd90> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11efd50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11efb90> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11efd90> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11efb90> |
token | <django.template.base.Token object at 0x7f5fa11efe10> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11efb90> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11efdd0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11efe10> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11efdd0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11efdd0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11f82d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11efdd0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11f8390> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11f8390> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11f8390> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11f83d0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11f8390> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11f8410> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11f8450> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11f8510> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11f85d0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11f8450> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11f8950>) |
token | <django.template.base.Token object at 0x7f5fa11f85d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11f8450> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11f8450> |
token | <django.template.base.Token object at 0x7f5fa11f8650> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11f8610> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11f8450> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11f8650> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11f8450> |
token | <django.template.base.Token object at 0x7f5fa11f86d0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11f8450> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11f8690>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11f86d0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11f8690>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11f8690>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11f8b50> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11f8690>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11f8c10> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11f8c10> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11f8c10> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11f8c50> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11f8c10> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11f8c90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11f8cd0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11f8d90> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11f8e50> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11f8cd0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1205210>) |
token | <django.template.base.Token object at 0x7f5fa11f8e50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11f8cd0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11f8cd0> |
token | <django.template.base.Token object at 0x7f5fa11f8ed0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11f8e90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11f8cd0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11f8ed0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11f8cd0> |
token | <django.template.base.Token object at 0x7f5fa11f8f50> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11f8cd0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11f8f10>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11f8f50> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11f8f10>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11f8f10>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1205350> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11f8f10>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1205410> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1205410> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1205410> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1205450> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1205410> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1205490> |
parser | <django.template.debug.DebugParser object at 0x7f5fa12054d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1205590> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1205650> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa12054d0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa12059d0>) |
token | <django.template.base.Token object at 0x7f5fa1205650> |
parser | <django.template.debug.DebugParser object at 0x7f5fa12054d0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa12054d0> |
token | <django.template.base.Token object at 0x7f5fa12056d0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1205690> |
parser | <django.template.debug.DebugParser object at 0x7f5fa12054d0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa12056d0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa12054d0> |
token | <django.template.base.Token object at 0x7f5fa1205750> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa12054d0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1205710>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1205750> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1205710>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1205710>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1205b10> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1205710>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1205bd0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1205bd0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1205bd0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1205c10> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1205bd0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1205c50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1205c90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1205d50> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1205e10> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1205c90> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa12131d0>) |
token | <django.template.base.Token object at 0x7f5fa1205e10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1205c90> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1205c90> |
token | <django.template.base.Token object at 0x7f5fa1205e90> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1205e50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1205c90> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1205e90> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1205c90> |
token | <django.template.base.Token object at 0x7f5fa1205f10> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1205c90> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1205ed0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1205f10> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1205ed0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1205ed0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1213310> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1205ed0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa12133d0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa12133d0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa12133d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1213410> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa12133d0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1213450> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1213490> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1213550> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1213610> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1213490> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1213990>) |
token | <django.template.base.Token object at 0x7f5fa1213610> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1213490> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1213490> |
token | <django.template.base.Token object at 0x7f5fa1213690> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1213650> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1213490> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1213690> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1213490> |
token | <django.template.base.Token object at 0x7f5fa1213710> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1213490> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12136d0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1213710> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12136d0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12136d0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1213ad0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa12136d0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1213b90> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1213b90> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1213b90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1213bd0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1213b90> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1213c10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1213c50> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1213d10> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1213dd0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1213c50> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa121f190>) |
token | <django.template.base.Token object at 0x7f5fa1213dd0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1213c50> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1213c50> |
token | <django.template.base.Token object at 0x7f5fa1213e50> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1213e10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1213c50> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1213e50> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1213c50> |
token | <django.template.base.Token object at 0x7f5fa1213ed0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1213c50> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1213e90>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1213ed0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1213e90>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1213e90>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa121f2d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1213e90>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa121f390> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa121f390> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa121f390> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa121f3d0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa121f390> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa121f410> |
parser | <django.template.debug.DebugParser object at 0x7f5fa121f450> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa121f510> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa121f5d0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa121f450> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa121f950>) |
token | <django.template.base.Token object at 0x7f5fa121f5d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa121f450> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa121f450> |
token | <django.template.base.Token object at 0x7f5fa121f650> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa121f610> |
parser | <django.template.debug.DebugParser object at 0x7f5fa121f450> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa121f650> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa121f450> |
token | <django.template.base.Token object at 0x7f5fa121f6d0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa121f450> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa121f690>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa121f6d0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa121f690>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa121f690>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa121fa90> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa121f690>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa121fb50> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa121fb50> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa121fb50> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa121fb90> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa121fb50> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa121fbd0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa121fc10> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa121fcd0> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa121fd90> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa121fc10> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11aa150>) |
token | <django.template.base.Token object at 0x7f5fa121fd90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa121fc10> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa121fc10> |
token | <django.template.base.Token object at 0x7f5fa121fe10> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa121fdd0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa121fc10> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa121fe10> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa121fc10> |
token | <django.template.base.Token object at 0x7f5fa121fe90> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa121fc10> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa121fe50>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa121fe90> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa121fe50>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa121fe50>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11aa290> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa121fe50>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11aa350> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11aa350> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11aa350> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11aa390> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11aa350> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11aa3d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11aa410> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11aa4d0> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11aa590> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11aa410> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11aa910>) |
token | <django.template.base.Token object at 0x7f5fa11aa590> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11aa410> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11aa410> |
token | <django.template.base.Token object at 0x7f5fa11aa610> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11aa5d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11aa410> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11aa610> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11aa410> |
token | <django.template.base.Token object at 0x7f5fa11aa690> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11aa410> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11aa650>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11aa690> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11aa650>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11aa650>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11aaa50> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11aa650>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11aab10> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11aab10> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11aab10> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11aab50> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11aab10> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11aab90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11aabd0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11aac90> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11aad50> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11aabd0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11b7110>) |
token | <django.template.base.Token object at 0x7f5fa11aad50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11aabd0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11aabd0> |
token | <django.template.base.Token object at 0x7f5fa11aadd0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11aad90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11aabd0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11aadd0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11aabd0> |
token | <django.template.base.Token object at 0x7f5fa11aae50> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11aabd0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11aae10>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11aae50> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11aae10>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11aae10>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11b7250> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11aae10>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11b7310> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11b7310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11b7310> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11b7350> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11b7310> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11b7390> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11b73d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11b7490> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11b7550> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11b73d0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11b78d0>) |
token | <django.template.base.Token object at 0x7f5fa11b7550> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11b73d0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11b73d0> |
token | <django.template.base.Token object at 0x7f5fa11b75d0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11b7590> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11b73d0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11b75d0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11b73d0> |
token | <django.template.base.Token object at 0x7f5fa11b7650> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11b73d0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11b7610>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11b7650> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11b7610>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11b7610>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11b7a10> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11b7610>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11b7ad0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11b7ad0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11b7ad0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11b7b10> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11b7ad0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11b7b50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11b7b90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11b7c50> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11b7d10> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11b7b90> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11c60d0>) |
token | <django.template.base.Token object at 0x7f5fa11b7d10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11b7b90> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11b7b90> |
token | <django.template.base.Token object at 0x7f5fa11b7d90> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11b7d50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11b7b90> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11b7d90> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11b7b90> |
token | <django.template.base.Token object at 0x7f5fa11b7e10> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11b7b90> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11b7dd0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11b7e10> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11b7dd0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11b7dd0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11c6210> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11b7dd0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11c62d0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11c62d0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11c62d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11c6310> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11c62d0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11c6350> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11c6390> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11c6450> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11c6510> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11c6390> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11c6890>) |
token | <django.template.base.Token object at 0x7f5fa11c6510> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11c6390> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11c6390> |
token | <django.template.base.Token object at 0x7f5fa11c6590> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11c6550> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11c6390> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11c6590> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11c6390> |
token | <django.template.base.Token object at 0x7f5fa11c6610> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11c6390> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11c65d0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11c6610> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11c65d0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11c65d0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11c69d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11c65d0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11c6a90> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11c6a90> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11c6a90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11c6ad0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11c6a90> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11c6b10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11c6b50> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11c6c10> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11c6cd0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11c6b50> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11d1090>) |
token | <django.template.base.Token object at 0x7f5fa11c6cd0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11c6b50> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11c6b50> |
token | <django.template.base.Token object at 0x7f5fa11c6d50> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11c6d10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11c6b50> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11c6d50> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11c6b50> |
token | <django.template.base.Token object at 0x7f5fa11c6dd0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11c6b50> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11c6d90>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11c6dd0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11c6d90>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11c6d90>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11d11d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11c6d90>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11d1290> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11d1290> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11d1290> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11d12d0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11d1290> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11d1310> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11d1350> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11d1410> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11d14d0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11d1350> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11d1850>) |
token | <django.template.base.Token object at 0x7f5fa11d14d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11d1350> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11d1350> |
token | <django.template.base.Token object at 0x7f5fa11d1550> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11d1510> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11d1350> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11d1550> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11d1350> |
token | <django.template.base.Token object at 0x7f5fa11d15d0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11d1350> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11d1590>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11d15d0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11d1590>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11d1590>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11d1990> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11d1590>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11d1a50> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11d1a50> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11d1a50> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11d1a90> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11d1a50> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11d1ad0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11d1b10> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11d1bd0> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11d1c90> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11d1b10> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11dc050>) |
token | <django.template.base.Token object at 0x7f5fa11d1c90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11d1b10> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11d1b10> |
token | <django.template.base.Token object at 0x7f5fa11d1d10> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11d1cd0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11d1b10> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11d1d10> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11d1b10> |
token | <django.template.base.Token object at 0x7f5fa11d1d90> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11d1b10> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11d1d50>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11d1d90> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11d1d50>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11d1d50>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11dc190> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11d1d50>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11dc250> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11dc250> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11dc250> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11dc290> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11dc250> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11dc2d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11dc310> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11dc3d0> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11dc490> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11dc310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11dc810>) |
token | <django.template.base.Token object at 0x7f5fa11dc490> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11dc310> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11dc310> |
token | <django.template.base.Token object at 0x7f5fa11dc510> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11dc4d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11dc310> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11dc510> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11dc310> |
token | <django.template.base.Token object at 0x7f5fa11dc590> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11dc310> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11dc550>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11dc590> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11dc550>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11dc550>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11dc950> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11dc550>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11dca10> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11dca10> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11dca10> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa11dca50> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11dca10> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11dca90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11dcad0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11dcb90> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa11dcc50> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11dcad0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11dcfd0>) |
token | <django.template.base.Token object at 0x7f5fa11dcc50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11dcad0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11dcad0> |
token | <django.template.base.Token object at 0x7f5fa11dccd0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11dcc90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11dcad0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11dccd0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11dcad0> |
token | <django.template.base.Token object at 0x7f5fa11dcd50> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11dcad0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11dcd10>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa11dcd50> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11dcd10>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11dcd10>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa116a150> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa11dcd10>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa116a210> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa116a210> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa116a210> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa116a250> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa116a210> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa116a290> |
parser | <django.template.debug.DebugParser object at 0x7f5fa116a2d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa116a390> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa116a450> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa116a2d0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa116a7d0>) |
token | <django.template.base.Token object at 0x7f5fa116a450> |
parser | <django.template.debug.DebugParser object at 0x7f5fa116a2d0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa116a2d0> |
token | <django.template.base.Token object at 0x7f5fa116a4d0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa116a490> |
parser | <django.template.debug.DebugParser object at 0x7f5fa116a2d0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa116a4d0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa116a2d0> |
token | <django.template.base.Token object at 0x7f5fa116a550> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa116a2d0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa116a510>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa116a550> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa116a510>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa116a510>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa116a910> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa116a510>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa116a9d0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa116a9d0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa116a9d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa116aa10> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa116a9d0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa116aa50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa116aa90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa116ab50> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa116ac10> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa116aa90> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa116af90>) |
token | <django.template.base.Token object at 0x7f5fa116ac10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa116aa90> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa116aa90> |
token | <django.template.base.Token object at 0x7f5fa116ac90> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa116ac50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa116aa90> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa116ac90> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa116aa90> |
token | <django.template.base.Token object at 0x7f5fa116ad10> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa116aa90> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa116acd0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa116ad10> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa116acd0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa116acd0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1176150> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa116acd0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1176210> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1176210> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1176210> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1176250> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1176210> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1176290> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11762d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1176390> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1176450> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa11762d0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa11767d0>) |
token | <django.template.base.Token object at 0x7f5fa1176450> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11762d0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11762d0> |
token | <django.template.base.Token object at 0x7f5fa11764d0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1176490> |
parser | <django.template.debug.DebugParser object at 0x7f5fa11762d0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa11764d0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa11762d0> |
token | <django.template.base.Token object at 0x7f5fa1176550> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa11762d0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1176510>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1176550> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1176510>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1176510>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa11769d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1176510>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1176a90> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1176a90> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1176a90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1176ad0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1176a90> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1176b10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1176b50> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1176c10> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1176cd0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1176b50> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1183090>) |
token | <django.template.base.Token object at 0x7f5fa1176cd0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1176b50> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1176b50> |
token | <django.template.base.Token object at 0x7f5fa1176d50> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1176d10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1176b50> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1176d50> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1176b50> |
token | <django.template.base.Token object at 0x7f5fa1176dd0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1176b50> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1176d90>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1176dd0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1176d90>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1176d90>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1183290> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1176d90>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1183350> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1183350> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1183350> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1183390> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1183350> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa11833d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1183410> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa11834d0> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1183590> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1183410> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1183910>) |
token | <django.template.base.Token object at 0x7f5fa1183590> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1183410> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1183410> |
token | <django.template.base.Token object at 0x7f5fa1183610> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa11835d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1183410> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1183610> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1183410> |
token | <django.template.base.Token object at 0x7f5fa1183690> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1183410> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1183650>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1183690> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1183650>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1183650>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1183b10> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1183650>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1183bd0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1183bd0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1183bd0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1183c10> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa1183bd0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1183c50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1183c90> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa1183d50> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa1183e10> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa1183c90> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa118a1d0>) |
token | <django.template.base.Token object at 0x7f5fa1183e10> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1183c90> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1183c90> |
token | <django.template.base.Token object at 0x7f5fa1183e90> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa1183e50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1183c90> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa1183e90> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1183c90> |
token | <django.template.base.Token object at 0x7f5fa1183f10> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa1183c90> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1183ed0>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1183f10> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1183ed0>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1183ed0>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa118a3d0> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1183ed0>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa118a490> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa118a490> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa118a490> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa118a4d0> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa118a490> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa118a510> |
parser | <django.template.debug.DebugParser object at 0x7f5fa118a550> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa118a610> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa118a6d0> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa118a550> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa118aa50>) |
token | <django.template.base.Token object at 0x7f5fa118a6d0> |
parser | <django.template.debug.DebugParser object at 0x7f5fa118a550> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa118a550> |
token | <django.template.base.Token object at 0x7f5fa118a750> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa118a710> |
parser | <django.template.debug.DebugParser object at 0x7f5fa118a550> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa118a750> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa118a550> |
token | <django.template.base.Token object at 0x7f5fa118a7d0> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa118a550> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa118a790>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa118a7d0> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa118a790>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa118a790>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa118ac50> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa118a790>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa118ad10> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa118ad10> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa118ad10> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa118ad50> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa118ad10> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa118ad90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa118add0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
filter_expression | <django.template.base.FilterExpression object at 0x7f5fa118ae90> |
nodelist | [<Text Node: '<a href="'>, <Variable Node: obj.get_url>, <Text Node: '">'>, <Variable Node: obj>, <Text Node: '</a> '>] |
var_node | <Variable Node: obj> |
token | <django.template.base.Token object at 0x7f5fa118af50> |
parse_until | [] |
command | u'if' |
compile_func | <function do_if at 0x7f5fa13e2410> |
self | <django.template.debug.DebugParser object at 0x7f5fa118add0> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==`` (or ``=``), ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
bits = token.split_contents()[1:]
var = TemplateIfParser(parser, bits).parse()
nodelist_true = parser.parse(('else', 'endif'))...
token = parser.next_token()
if token.contents == 'else':
nodelist_false = parser.parse(('endif',))
parser.delete_first_token()
else:
nodelist_false = NodeList()
Variable | Value |
---|---|
var | (literal <django.template.base.FilterExpression object at 0x7f5fa1198310>) |
token | <django.template.base.Token object at 0x7f5fa118af50> |
parser | <django.template.debug.DebugParser object at 0x7f5fa118add0> |
bits | [u'obj.module_set.all.count'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <ul> '>] |
self | <django.template.debug.DebugParser object at 0x7f5fa118add0> |
token | <django.template.base.Token object at 0x7f5fa118afd0> |
parse_until | ('else', 'endif') |
command | u'for' |
compile_func | <function do_for at 0x7f5fa13e2230> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/defaulttags.py
in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or ' ' in var:
raise TemplateSyntaxError("'for' tag received an invalid argument:"
" %s" % token.contents)
sequence = parser.compile_filter(bits[in_index+1])
nodelist_loop = parser.parse(('empty', 'endfor',))...
token = parser.next_token()
if token.contents == 'empty':
nodelist_empty = parser.parse(('endfor',))
parser.delete_first_token()
else:
nodelist_empty = None
Variable | Value |
---|---|
loopvars | [u'cat'] |
sequence | <django.template.base.FilterExpression object at 0x7f5fa118af90> |
parser | <django.template.debug.DebugParser object at 0x7f5fa118add0> |
in_index | -2 |
token | <django.template.base.Token object at 0x7f5fa118afd0> |
var | u'cat' |
is_reversed | False |
bits | [u'for', u'cat', u'in', u'obj.module_set.all'] |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
# execute callback function for this tag and append resulting node
self.enter_command(command, token)
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
try:
compiled_result = compile_func(self, token)...
except TemplateSyntaxError, e:
if not self.compile_function_error(token, e):
raise
self.extend_nodelist(nodelist, compiled_result, token)
self.exit_command()
if parse_until:
Variable | Value |
---|---|
nodelist | [<Text Node: ' <li>'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa118add0> |
token | <django.template.base.Token object at 0x7f5fa1198090> |
parse_until | ('empty', 'endfor') |
command | u'include' |
compile_func | <function do_include at 0x7f5fa137e938> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in do_include
(bits[0], option))
options[option] = value
isolated_context = options.get('only', False)
namemap = options.get('with', {})
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1], extra_context=namemap,
isolated_context=isolated_context)...
return IncludeNode(parser.compile_filter(bits[1]), extra_context=namemap,
isolated_context=isolated_context)
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
Variable | Value |
---|---|
option | u'with' |
parser | <django.template.debug.DebugParser object at 0x7f5fa118add0> |
value | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1198050>} |
isolated_context | False |
token | <django.template.base.Token object at 0x7f5fa1198090> |
namemap | {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1198050>} |
path | u'"sitemap_elements.html"' |
remaining_bits | [] |
bits | [u'include', u'"sitemap_elements.html"', u'with', u'obj=cat'] |
options | {u'with': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1198050>}} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader_tags.py
in __init__
context.pop()
return output
class ConstantIncludeNode(BaseIncludeNode):
def __init__(self, template_path, *args, **kwargs):
super(ConstantIncludeNode, self).__init__(*args, **kwargs)
try:
t = get_template(template_path)...
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
Variable | Value |
---|---|
self | <django.template.loader_tags.ConstantIncludeNode object at 0x7f5fa1198510> |
args | () |
template_path | u'sitemap_elements.html' |
kwargs | {'extra_context': {u'obj': <django.template.base.FilterExpression object at 0x7f5fa1198050>}, 'isolated_context': False} |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template
return template, origin
def get_template(template_name):
"""
Returns a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = find_template(template_name)...
if not hasattr(template, 'render'):
# template needs to be compiled
template = get_template_from_string(template, origin, template_name)
return template
def get_template_from_string(source, origin=None, name=None):
Variable | Value |
---|---|
template_name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in find_template
for loader_name in settings.TEMPLATE_LOADERS:
loader = find_template_loader(loader_name)
if loader is not None:
loaders.append(loader)
template_source_loaders = tuple(loaders)
for loader in template_source_loaders:
try:
source, display_name = loader(name, dirs)...
return (source, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def find_template_source(name, dirs=None):
Variable | Value |
---|---|
dirs | None |
name | u'sitemap_elements.html' |
loader | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in __call__
class BaseLoader(object):
is_usable = False
def __init__(self, *args, **kwargs):
pass
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)...
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)
Variable | Value |
---|---|
template_dirs | None |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in load_template
def __call__(self, template_name, template_dirs=None):
return self.load_template(template_name, template_dirs)
def load_template(self, template_name, template_dirs=None):
source, display_name = self.load_template_source(template_name, template_dirs)
origin = make_origin(display_name, self.load_template_source, template_name, template_dirs)
try:
template = get_template_from_string(source, origin, template_name)...
return template, None
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist, back off to
# returning the source and display name for the template we were asked to load.
# This allows for correct identification (later) of the actual template that does
# not exist.
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11985d0> |
template_dirs | None |
display_name | u'/home/users/v/vizelman/django/main/templates/sitemap_elements.html' |
template_name | u'sitemap_elements.html' |
self | <django.template.loaders.filesystem.Loader object at 0x7f5fa128e310> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/loader.py
in get_template_from_string
return template
def get_template_from_string(source, origin=None, name=None):
"""
Returns a compiled Template object for the given template code,
handling template inheritance recursively.
"""
return Template(source, origin, name)...
def render_to_string(template_name, dictionary=None, context_instance=None):
"""
Loads the given template_name and renders it with the given dictionary as
context. The template_name may be a string to load a single template using
get_template, or it may be a tuple to use select_template to find one of
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11985d0> |
source | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
def __init__(self, template_string, origin=None, name='<Unknown Template>'):
try:
template_string = smart_unicode(template_string)
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed from unicode or UTF-8 strings.")
if settings.TEMPLATE_DEBUG and origin is None:
origin = StringOrigin(template_string)
self.nodelist = compile_string(template_string, origin)...
self.name = name
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
Variable | Value |
---|---|
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11985d0> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
self | <django.template.base.Template object at 0x7f5fa1198610> |
name | u'sitemap_elements.html' |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_string
if settings.TEMPLATE_DEBUG:
from 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()...
class Token(object):
def __init__(self, token_type, contents):
# token_type must be TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK or TOKEN_COMMENT.
self.token_type, self.contents = token_type, contents
self.lineno = None
Variable | Value |
---|---|
lexer_class | <class 'django.template.debug.DebugLexer'> |
origin | <django.template.loader.LoaderOrigin object at 0x7f5fa11985d0> |
DebugLexer | <class 'django.template.debug.DebugLexer'> |
lexer | <django.template.debug.DebugLexer object at 0x7f5fa1198650> |
parser | <django.template.debug.DebugParser object at 0x7f5fa1198690> |
template_string | u'<a href="{{ obj.get_url }}">{{ obj }}</a>\n{% if obj.module_set.all.count %}\n<ul>\n\t{% for cat in obj.module_set.all %}\n\t<li>{% include "sitemap_elements.html" with obj=cat %}</li>\n\t{% endfor %}\n</ul>\n{% endif %}' |
DebugParser | <class 'django.template.debug.DebugParser'> |
parser_class | <class 'django.template.debug.DebugParser'> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in parse
while self.tokens:
token = self.next_token()
if token.token_type == TOKEN_TEXT:
self.extend_nodelist(nodelist, TextNode(token.contents), token)
elif token.token_type == TOKEN_VAR:
if not token.contents:
self.empty_variable(token)
filter_expression = self.compile_filter(token.contents)...
var_node = self.create_variable_node(filter_expression)
self.extend_nodelist(nodelist, var_node,token)
elif token.token_type == TOKEN_BLOCK:
if token.contents in parse_until:
# put token back on token list so calling code knows why it terminated
self.prepend_token(token)
Variable | Value |
---|---|
token | <django.template.base.Token object at 0x7f5fa1198710> |
parse_until | [] |
nodelist | [<Text Node: '<a href="'>] |
self | <django.template.debug.DebugParser object at 0x7f5fa1198690> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in compile_filter
def add_library(self, lib):
self.tags.update(lib.tags)
self.filters.update(lib.filters)
def compile_filter(self, token):
"Convenient wrapper for FilterExpression"
return FilterExpression(token, self)...
def find_filter(self, filter_name):
if filter_name in self.filters:
return self.filters[filter_name]
else:
raise TemplateSyntaxError("Invalid filter: '%s'" % filter_name)
Variable | Value |
---|---|
token | u'obj.get_url' |
self | <django.template.debug.DebugParser object at 0x7f5fa1198690> |
/home/users/v/vizelman/virtualenv/MyEnv/lib/python2.7/site-packages/django/template/base.py
in __init__
try:
var_obj = Variable(constant).resolve({})
except VariableDoesNotExist:
var_obj = None
elif var is None:
raise TemplateSyntaxError("Could not find variable at start of %s." % token)
else:
var_obj = Variable(var)...
else:
filter_name = match.group("filter_name")
args = []
constant_arg, var_arg = match.group("constant_arg", "var_arg")
if constant_arg:
args.append((False, Variable(constant_arg).resolve({})))
Variable | Value |
---|---|
upto | 0 |
constant | None |
matches | <callable-iterator object at 0x7f5fa1198a90> |
var_obj | None |
parser | <django.template.debug.DebugParser object at 0x7f5fa1198690> |
start | 0 |
token | u'obj.get_url' |
filters | [] |
var | u'obj.get_url' |
self | <django.template.base.FilterExpression object at 0x7f5fa11986d0> |
match | <_sre.SRE_Match object at 0x7f5fa11a0030> |
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
mod_wsgi.listener_port | '80' |
REDIRECT_STATUS | '200' |
SERVER_SOFTWARE | 'Apache' |
SCRIPT_NAME | u'' |
mod_wsgi.handler_script | '' |
SERVER_SIGNATURE | '' |
REQUEST_METHOD | 'GET' |
PATH_INFO | u'/sitemap/html/' |
REDIRECT_URL | '/sitemap/html/' |
SERVER_PROTOCOL | 'HTTP/1.0' |
QUERY_STRING | '' |
REDIRECT_suppress-error-charset | '' |
HTTP_X_REAL_IP | '54.225.1.66' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_CONNECTION | 'close' |
SERVER_NAME | 'www.vizelman.ru' |
REMOTE_ADDR | '54.225.1.66' |
HTTP_X_FORWARDED_PROTOCOL | 'http' |
mod_wsgi.request_handler | 'wsgi-script' |
wsgi.url_scheme | 'http' |
HTTP_X_PROTOCOL | 'HTTP/1.1' |
PATH_TRANSLATED | 'redirect:/django.wsgi/sitemap/html//html/' |
SERVER_PORT | '80' |
wsgi.multiprocess | True |
mod_wsgi.input_chunked | '0' |
SERVER_ADDR | '81.177.141.143' |
DOCUMENT_ROOT | '/home/users/v/vizelman/domains/vizelman.ru' |
mod_wsgi.process_group | '' |
HTTP_X_FORWARDED_PROTO | 'http' |
SCRIPT_FILENAME | '/home/users/v/vizelman/domains/vizelman.ru/django.wsgi' |
SERVER_ADMIN | 'info@jino.ru' |
wsgi.input | <mod_wsgi.Input object at 0x7f5fa50bc830> |
HTTP_HOST | 'www.vizelman.ru' |
wsgi.multithread | False |
suppress-error-charset | '' |
mod_wsgi.callable_object | 'application' |
REQUEST_URI | '/sitemap/html/' |
HTTP_ACCEPT | '*/*' |
wsgi.version | (1, 1) |
GATEWAY_INTERFACE | 'CGI/1.1' |
HTTP_X_FORWARDED_FOR | '54.225.1.66' |
wsgi.errors | <mod_wsgi.Log object at 0x7f5fa5140e70> |
REMOTE_PORT | '43836' |
mod_wsgi.listener_host | '' |
mod_wsgi.version | (3, 2) |
downgrade-1.0 | '' |
wsgi.run_once | False |
REDIRECT_downgrade-1.0 | '' |
mod_wsgi.application_group | 'www.vizelman.ru|/django.wsgi' |
mod_wsgi.script_reloading | '1' |
wsgi.file_wrapper | '' |
CSRF_COOKIE | '97f4f525121d02f9004488ec4618ab74' |
HTTP_X_SERVER_IP | '81.177.141.143' |
main.settings
Setting | Value |
---|---|
USE_L10N | True |
USE_THOUSAND_SEPARATOR | False |
LANGUAGE_CODE | 'ru-RU' |
ROOT_URLCONF | 'main.urls' |
MANAGERS | () |
DEFAULT_CHARSET | 'utf-8' |
STATIC_ROOT | '/home/users1/v/vizelman/domains/vizelman.ru/static/' |
TEST_DATABASE_CHARSET | None |
ALLOWED_HOSTS | ['vizelman.ru', 'www.vizelman.ru'] |
MESSAGE_STORAGE | 'django.contrib.messages.storage.user_messages.LegacyFallbackStorage' |
DATABASE_HOST | '' |
EMAIL_SUBJECT_PREFIX | '[Django] ' |
SEND_BROKEN_LINK_EMAILS | False |
URL_VALIDATOR_USER_AGENT | 'Django/1.3 (http://www.djangoproject.com)' |
STATICFILES_FINDERS | ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder') |
SESSION_COOKIE_DOMAIN | None |
SESSION_COOKIE_NAME | 'sessionid' |
ADMIN_FOR | () |
TIME_INPUT_FORMATS | ('%H:%M:%S', '%H:%M') |
DATABASES | {'default': {'ENGINE': 'django.db.backends.mysql', 'HOST': '127.0.0.1', 'NAME': 'vizelman', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': '', 'TEST_CHARSET': None, 'TEST_COLLATION': None, 'TEST_MIRROR': None, 'TEST_NAME': None, 'TIME_ZONE': 'Europe/Moscow', 'USER': 'vizelman'}} |
TEST_DATABASE_NAME | None |
FILE_UPLOAD_PERMISSIONS | None |
FILE_UPLOAD_HANDLERS | ('django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler') |
DEFAULT_CONTENT_TYPE | 'text/html' |
APPEND_SLASH | True |
FIRST_DAY_OF_WEEK | 0 |
DATABASE_ROUTERS | [] |
YEAR_MONTH_FORMAT | 'F Y' |
STATICFILES_STORAGE | 'django.contrib.staticfiles.storage.StaticFilesStorage' |
CACHES | {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', 'LOCATION': ''}} |
SERVER_EMAIL | 'root@localhost' |
SESSION_COOKIE_PATH | '/' |
IGNORABLE_404_ENDS | ('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php') |
MIDDLEWARE_CLASSES | ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') |
USE_I18N | True |
THOUSAND_SEPARATOR | ',' |
SECRET_KEY | '********************' |
LANGUAGE_COOKIE_NAME | 'django_language' |
FILE_UPLOAD_TEMP_DIR | None |
TRANSACTIONS_MANAGED | False |
LOGGING_CONFIG | 'django.utils.log.dictConfig' |
TEMPLATE_LOADERS | ('django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader') |
TEMPLATE_DEBUG | True |
AUTHENTICATION_BACKENDS | ('django.contrib.auth.backends.ModelBackend',) |
TEST_DATABASE_COLLATION | None |
FORCE_SCRIPT_NAME | None |
CACHE_BACKEND | 'locmem://' |
SESSION_COOKIE_SECURE | False |
CSRF_COOKIE_DOMAIN | None |
FILE_CHARSET | 'utf-8' |
DEBUG | True |
SESSION_FILE_PATH | None |
DEFAULT_FILE_STORAGE | 'django.core.files.storage.FileSystemStorage' |
INSTALLED_APPS | ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.staticfiles', 'grappelli', 'django.contrib.admin', 'main.content'] |
LANGUAGES | (('ar', 'Arabic'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('bn', 'Bengali'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('en-gb', 'British English'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy-nl', 'Frisian'), ('ga', 'Irish'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hu', 'Hungarian'), ('id', 'Indonesian'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('nb', 'Norwegian Bokmal'), ('nn', 'Norwegian Nynorsk'), ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'), ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('vi', 'Vietnamese'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')) |
DATABASE_ENGINE | '' |
DATABASE_NAME | '' |
COMMENTS_FIRST_FEW | 0 |
PREPEND_WWW | True |
GRAPPELLI_ADMIN_TITLE | u'\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c Vizelman.ru' |
SESSION_COOKIE_HTTPONLY | False |
DATABASE_PORT | '' |
DEBUG_PROPAGATE_EXCEPTIONS | False |
MONTH_DAY_FORMAT | 'F j' |
LOGIN_URL | '/accounts/login/' |
SESSION_EXPIRE_AT_BROWSER_CLOSE | False |
TIME_FORMAT | 'P' |
DATE_INPUT_FORMATS | ('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y') |
CSRF_COOKIE_NAME | 'csrftoken' |
EMAIL_HOST_PASSWORD | '********************' |
PASSWORD_RESET_TIMEOUT_DAYS | '********************' |
CACHE_MIDDLEWARE_ALIAS | 'default' |
SESSION_SAVE_EVERY_REQUEST | False |
ADMIN_MEDIA_PREFIX | 'http://vizelman.ru/static/grappelli/' |
NUMBER_GROUPING | 0 |
SESSION_ENGINE | 'django.contrib.sessions.backends.db' |
CSRF_FAILURE_VIEW | 'django.views.csrf.csrf_failure' |
COMMENTS_SKETCHY_USERS_GROUP | None |
LOGIN_REDIRECT_URL | '/accounts/profile/' |
LOGGING | {'disable_existing_loggers': False, 'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler', 'level': 'ERROR'}}, 'loggers': {'django.request': {'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True}}, 'version': 1} |
CACHE_MIDDLEWARE_KEY_PREFIX | '' |
LOCALE_PATHS | () |
TEMPLATE_STRING_IF_INVALID | '' |
COMMENTS_ALLOW_PROFANITIES | False |
LOGOUT_URL | '/accounts/logout/' |
EMAIL_USE_TLS | False |
TEMPLATE_DIRS | ('/home/users/v/vizelman/django/main/templates',) |
FIXTURE_DIRS | () |
EMAIL_HOST | 'localhost' |
DATE_FORMAT | 'N j, Y' |
MEDIA_ROOT | '/home/users1/v/vizelman/domains/vizelman.ru/media/' |
ADMINS | () |
FORMAT_MODULE_PATH | None |
DEFAULT_FROM_EMAIL | 'webmaster@localhost' |
STATICFILES_DIRS | () |
MEDIA_URL | 'http://vizelman.ru/media/' |
DATETIME_FORMAT | 'N j, Y, P' |
IGNORABLE_404_STARTS | ('/cgi-bin/', '/_vti_bin', '/_vti_inf') |
SITE_ID | 1 |
DISALLOWED_USER_AGENTS | () |
ALLOWED_INCLUDE_ROOTS | () |
DECIMAL_SEPARATOR | '.' |
SHORT_DATE_FORMAT | 'm/d/Y' |
DATABASE_USER | '' |
TEST_RUNNER | 'django.test.simple.DjangoTestSuiteRunner' |
TIME_ZONE | 'Europe/Moscow' |
FILE_UPLOAD_MAX_MEMORY_SIZE | 2621440 |
EMAIL_BACKEND | 'django.core.mail.backends.smtp.EmailBackend' |
DEFAULT_TABLESPACE | '' |
TEMPLATE_CONTEXT_PROCESSORS | ('django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.contrib.messages.context_processors.messages', 'main.context.extra_var') |
SESSION_COOKIE_AGE | 1209600 |
SETTINGS_MODULE | 'main.settings' |
USE_ETAGS | False |
LANGUAGES_BIDI | ('he', 'ar', 'fa') |
DEFAULT_INDEX_TABLESPACE | '' |
INTERNAL_IPS | () |
STATIC_URL | 'http://vizelman.ru/static/' |
EMAIL_PORT | 25 |
SHORT_DATETIME_FORMAT | 'm/d/Y P' |
ABSOLUTE_URL_OVERRIDES | {} |
DATABASE_OPTIONS | {} |
CACHE_MIDDLEWARE_SECONDS | 600 |
BANNED_IPS | () |
DATETIME_INPUT_FORMATS | ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M', '%m/%d/%y') |
DATABASE_PASSWORD | '********************' |
COMMENTS_MODERATORS_GROUP | None |
COMMENTS_BANNED_USERS_GROUP | None |
EMAIL_HOST_USER | '' |
PROFANITIES_LIST | '********************' |
You're seeing this error because you have DEBUG = True
in your
Django settings file. Change that to False
, and Django will
display a standard 500 page.