Invalid block tag on line 16: 'ifequal', expected 'endblock'. Did you forget to register or load this tag?
Request Method: | GET |
---|---|
Request URL: | http://apatrid.ru/en/buy_records |
Django Version: | 4.2.8 |
Exception Type: | TemplateSyntaxError |
Exception Value: | Invalid block tag on line 16: 'ifequal', expected 'endblock'. Did you forget to register or load this tag? |
Exception Location: | /home/aenv/lib/python3.10/site-packages/django/template/base.py, line 558, in invalid_block_tag |
Raised during: | django.views.generic.base.TemplateView |
Python Executable: | /usr/local/bin/uwsgi |
Python Version: | 3.10.12 |
Python Path: | ['.', '', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/home/aenv/lib/python3.10/site-packages'] |
Server time: | Tue, 19 Mar 2024 11:23:21 +0000 |
In template /home/apatrid/templates/music/buy_records.html
, error at line 16
6 | |
---|---|
7 | {% block main %} |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | <div class="article_text"> |
15 | |
16 | {% ifequal LANGUAGE_CODE 'ru' %} |
17 | |
18 | <h1>Купим ваши пластинки</h1> |
19 | |
20 | Хотите продать пластинки? Свяжитесь с нами!<br> |
21 | Если у Вас есть интересные пластинки, мы готовы их купить. Шлите списки и фото.<br> |
22 | Оформление и состояние конверта имеют значение, поэтому без фото продать что-то будет сложнее.<br> |
23 | Интересуют советские виниловые пластинки с музыкой любых жанров — классика, эстрада, джаз, рок. |
24 | <br><br> |
25 | |
26 | Электронная почта: a-p-a-t-r-i-d.ru@gmail.com (уберите дефисы)<br> |
/home/aenv/lib/python3.10/site-packages/django/template/base.py
, line 505, in parse
# Add the token to the command stack. This is used for error
# messages if further parsing fails due to an unclosed block
# tag.
self.command_stack.append((command, token))
# Get the tag callback function from the ones registered with
# the parser.
try:
compile_func = self.tags[command]…
except KeyError:
self.invalid_block_tag(token, command, parse_until)
# Compile the callback into a node object and add it to
# the node list.
try:
compiled_result = compile_func(self, token)
Variable | Value |
---|---|
command | 'ifequal' |
nodelist | [<TextNode: '\n\n\n\n\n\n\n<div class="articl'>] |
parse_until | ('endblock',) |
self | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
token | <Block token: "ifequal LANGUAGE_COD..."> |
token_type | 2 |
/home/aenv/lib/python3.10/site-packages/django/core/handlers/exception.py
, line 55, in inner
return inner
else:
@wraps(get_response)
def inner(request):
try:
response = get_response(request)…
except Exception as exc:
response = response_for_exception(request, exc)
return response
return inner
Variable | Value |
---|---|
exc | TemplateSyntaxError("Invalid block tag on line 16: 'ifequal', expected 'endblock'. Did you forget to register or load this tag?") |
get_response | <bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f1e2773ac20>> |
request | <WSGIRequest: GET '/en/buy_records'> |
/home/aenv/lib/python3.10/site-packages/django/core/handlers/base.py
, line 220, in _get_response
self.check_response(
response,
middleware_method,
name="%s.process_template_response"
% (middleware_method.__self__.__class__.__name__,),
)
try:
response = response.render()…
except Exception as e:
response = self.process_exception_by_middleware(e, request)
if response is None:
raise
return response
Variable | Value |
---|---|
callback | <function View.as_view.<locals>.view at 0x7f1e26163130> |
callback_args | () |
callback_kwargs | {} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <CsrfViewMiddleware get_response=convert_exception_to_response.<locals>.inner>> |
request | <WSGIRequest: GET '/en/buy_records'> |
response | None |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f1e2773ac20> |
wrapped_callback | <function View.as_view.<locals>.view at 0x7f1e26163130> |
/home/aenv/lib/python3.10/site-packages/django/template/response.py
, line 114, in render
If the content has already been rendered, this is a no-op.
Return the baked response instance.
"""
retval = self
if not self._is_rendered:
self.content = self.rendered_content…
for post_callback in self._post_render_callbacks:
newretval = post_callback(retval)
if newretval is not None:
retval = newretval
return retval
Variable | Value |
---|---|
retval | <TemplateResponse status_code=200, "text/html; charset=utf-8"> |
self | <TemplateResponse status_code=200, "text/html; charset=utf-8"> |
/home/aenv/lib/python3.10/site-packages/django/template/response.py
, line 90, in rendered_content
"""Return 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)
return template.render(context, self._request)
def add_post_render_callback(self, callback):
"""Add a new post-rendering callback.
Variable | Value |
---|---|
self | <TemplateResponse status_code=200, "text/html; charset=utf-8"> |
/home/aenv/lib/python3.10/site-packages/django/template/response.py
, line 72, in resolve_template
del obj_dict[attr]
return obj_dict
def resolve_template(self, template):
"""Accept a template object, path-to-template, or list of paths."""
if isinstance(template, (list, tuple)):
return select_template(template, using=self.using)…
elif isinstance(template, str):
return get_template(template, using=self.using)
else:
return template
def resolve_context(self, context):
Variable | Value |
---|---|
self | <TemplateResponse status_code=200, "text/html; charset=utf-8"> |
template | ['music/buy_records.html'] |
/home/aenv/lib/python3.10/site-packages/django/template/loader.py
, line 42, in select_template
)
chain = []
engines = _engine_list(using)
for template_name in template_name_list:
for engine in engines:
try:
return engine.get_template(template_name)…
except TemplateDoesNotExist as e:
chain.append(e)
if template_name_list:
raise TemplateDoesNotExist(", ".join(template_name_list), chain=chain)
else:
Variable | Value |
---|---|
chain | [] |
engine | <django.template.backends.django.DjangoTemplates object at 0x7f1e261b3d90> |
engines | [<django.template.backends.django.DjangoTemplates object at 0x7f1e261b3d90>] |
template_name | 'music/buy_records.html' |
template_name_list | ['music/buy_records.html'] |
using | None |
/home/aenv/lib/python3.10/site-packages/django/template/backends/django.py
, line 33, in get_template
self.engine = Engine(self.dirs, self.app_dirs, **options)
def from_string(self, template_code):
return Template(self.engine.from_string(template_code), self)
def get_template(self, template_name):
try:
return Template(self.engine.get_template(template_name), self)…
except TemplateDoesNotExist as exc:
reraise(exc, self)
def get_templatetag_libraries(self, custom_libraries):
"""
Return a collation of template tag libraries from installed
Variable | Value |
---|---|
self | <django.template.backends.django.DjangoTemplates object at 0x7f1e261b3d90> |
template_name | 'music/buy_records.html' |
/home/aenv/lib/python3.10/site-packages/django/template/engine.py
, line 175, in get_template
return Template(template_code, engine=self)
def get_template(self, template_name):
"""
Return a compiled Template object for the given template name,
handling template inheritance recursively.
"""
template, origin = self.find_template(template_name)…
if not hasattr(template, "render"):
# template needs to be compiled
template = Template(template, origin, template_name, engine=self)
return template
def render_to_string(self, template_name, context=None):
Variable | Value |
---|---|
self | <Engine: dirs=['/home/apatrid/templates'] app_dirs=True context_processors=['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'music.context_processors.languages_list'] debug=True loaders=[('django.template.loaders.cached.Loader', ['django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader'])] string_if_invalid='' file_charset='utf-8' libraries={'cache': 'django.templatetags.cache', 'i18n': 'django.templatetags.i18n', 'l10n': 'django.templatetags.l10n', 'static': 'django.templatetags.static', 'tz': 'django.templatetags.tz', 'admin_list': 'django.contrib.admin.templatetags.admin_list', 'admin_modify': 'django.contrib.admin.templatetags.admin_modify', 'admin_urls': 'django.contrib.admin.templatetags.admin_urls', 'log': 'django.contrib.admin.templatetags.log', 'music_tags': 'music.templatetags.music_tags'} builtins=['django.template.defaulttags', 'django.template.defaultfilters', 'django.template.loader_tags'] autoescape=True> |
template_name | 'music/buy_records.html' |
/home/aenv/lib/python3.10/site-packages/django/template/engine.py
, line 157, in find_template
"Invalid value in template loaders configuration: %r" % loader
)
def find_template(self, name, dirs=None, skip=None):
tried = []
for loader in self.template_loaders:
try:
template = loader.get_template(name, skip=skip)…
return template, template.origin
except TemplateDoesNotExist as e:
tried.extend(e.tried)
raise TemplateDoesNotExist(name, tried=tried)
def from_string(self, template_code):
Variable | Value |
---|---|
dirs | None |
loader | <django.template.loaders.cached.Loader object at 0x7f1e261b3e20> |
name | 'music/buy_records.html' |
self | <Engine: dirs=['/home/apatrid/templates'] app_dirs=True context_processors=['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'music.context_processors.languages_list'] debug=True loaders=[('django.template.loaders.cached.Loader', ['django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader'])] string_if_invalid='' file_charset='utf-8' libraries={'cache': 'django.templatetags.cache', 'i18n': 'django.templatetags.i18n', 'l10n': 'django.templatetags.l10n', 'static': 'django.templatetags.static', 'tz': 'django.templatetags.tz', 'admin_list': 'django.contrib.admin.templatetags.admin_list', 'admin_modify': 'django.contrib.admin.templatetags.admin_modify', 'admin_urls': 'django.contrib.admin.templatetags.admin_urls', 'log': 'django.contrib.admin.templatetags.log', 'music_tags': 'music.templatetags.music_tags'} builtins=['django.template.defaulttags', 'django.template.defaultfilters', 'django.template.loader_tags'] autoescape=True> |
skip | None |
tried | [] |
/home/aenv/lib/python3.10/site-packages/django/template/loaders/cached.py
, line 57, in get_template
if isinstance(cached, type) and issubclass(cached, TemplateDoesNotExist):
raise cached(template_name)
elif isinstance(cached, TemplateDoesNotExist):
raise copy_exception(cached)
return cached
try:
template = super().get_template(template_name, skip)…
except TemplateDoesNotExist as e:
self.get_template_cache[key] = (
copy_exception(e) if self.engine.debug else TemplateDoesNotExist
)
raise
else:
Variable | Value |
---|---|
__class__ | <class 'django.template.loaders.cached.Loader'> |
cached | None |
key | 'music/buy_records.html' |
self | <django.template.loaders.cached.Loader object at 0x7f1e261b3e20> |
skip | None |
template_name | 'music/buy_records.html' |
/home/aenv/lib/python3.10/site-packages/django/template/loaders/base.py
, line 28, in get_template
try:
contents = self.get_contents(origin)
except TemplateDoesNotExist:
tried.append((origin, "Source does not exist"))
continue
else:
return Template(…
contents,
origin,
origin.template_name,
self.engine,
)
Variable | Value |
---|---|
contents | ('{% extends "music/base.html" %}\n' '{% load i18n %}\n' '\n' "{% block title %}{% trans 'Купим ваши пластинки' %}{% endblock %}\n" '{% block description %}{% endblock %}\n' '\n' '{% block main %}\n' '\n' '\n' '\n' '\n' '\n' '\n' '<div class="article_text">\n' '\n' "{% ifequal LANGUAGE_CODE 'ru' %}\n" '\n' '<h1>Купим ваши пластинки</h1>\n' '\n' 'Хотите продать пластинки? Свяжитесь с нами!<br>\n' 'Если у Вас есть интересные пластинки, мы готовы их купить. Шлите списки и ' 'фото.<br>\n' 'Оформление и состояние конверта имеют значение, поэтому без фото продать ' 'что-то будет сложнее.<br>\n' 'Интересуют советские виниловые пластинки с музыкой любых жанров — классика, ' 'эстрада, джаз, рок.\n' '<br><br>\n' '\n' 'Электронная почта: a-p-a-t-r-i-d.ru@gmail.com (уберите ' 'дефисы)<br>\n' '\n' '\n' '\n' '\n' '{% else %}\n' '\n' '<h1>We buy records.</h1>\n' '\n' 'We are interested in purchase of USSR period records.\n' '<br><br>\n' '\n' 'E-mail:</td><td>a-p-a-t-r-i-d.ru@gmail.com (remove hyphens)\n' '\n' '{% endifequal %}\n' '</div>\n' '\n' '\n' '\n' '\n' '\n' '{% endblock %}') |
origin | <Origin name='/home/apatrid/templates/music/buy_records.html'> |
self | <django.template.loaders.cached.Loader object at 0x7f1e261b3e20> |
skip | None |
template_name | 'music/buy_records.html' |
tried | [] |
/home/aenv/lib/python3.10/site-packages/django/template/base.py
, line 154, in __init__
engine = Engine.get_default()
if origin is None:
origin = Origin(UNKNOWN_SOURCE)
self.name = name
self.origin = origin
self.engine = engine
self.source = str(template_string) # May be lazy.
self.nodelist = self.compile_nodelist()…
def __iter__(self):
for node in self.nodelist:
yield from node
def __repr__(self):
Variable | Value |
---|---|
engine | <Engine: dirs=['/home/apatrid/templates'] app_dirs=True context_processors=['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'music.context_processors.languages_list'] debug=True loaders=[('django.template.loaders.cached.Loader', ['django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader'])] string_if_invalid='' file_charset='utf-8' libraries={'cache': 'django.templatetags.cache', 'i18n': 'django.templatetags.i18n', 'l10n': 'django.templatetags.l10n', 'static': 'django.templatetags.static', 'tz': 'django.templatetags.tz', 'admin_list': 'django.contrib.admin.templatetags.admin_list', 'admin_modify': 'django.contrib.admin.templatetags.admin_modify', 'admin_urls': 'django.contrib.admin.templatetags.admin_urls', 'log': 'django.contrib.admin.templatetags.log', 'music_tags': 'music.templatetags.music_tags'} builtins=['django.template.defaulttags', 'django.template.defaultfilters', 'django.template.loader_tags'] autoescape=True> |
name | 'music/buy_records.html' |
origin | <Origin name='/home/apatrid/templates/music/buy_records.html'> |
self | <Template template_string="{% extends "music/ba..."> |
template_string | ('{% extends "music/base.html" %}\n' '{% load i18n %}\n' '\n' "{% block title %}{% trans 'Купим ваши пластинки' %}{% endblock %}\n" '{% block description %}{% endblock %}\n' '\n' '{% block main %}\n' '\n' '\n' '\n' '\n' '\n' '\n' '<div class="article_text">\n' '\n' "{% ifequal LANGUAGE_CODE 'ru' %}\n" '\n' '<h1>Купим ваши пластинки</h1>\n' '\n' 'Хотите продать пластинки? Свяжитесь с нами!<br>\n' 'Если у Вас есть интересные пластинки, мы готовы их купить. Шлите списки и ' 'фото.<br>\n' 'Оформление и состояние конверта имеют значение, поэтому без фото продать ' 'что-то будет сложнее.<br>\n' 'Интересуют советские виниловые пластинки с музыкой любых жанров — классика, ' 'эстрада, джаз, рок.\n' '<br><br>\n' '\n' 'Электронная почта: a-p-a-t-r-i-d.ru@gmail.com (уберите ' 'дефисы)<br>\n' '\n' '\n' '\n' '\n' '{% else %}\n' '\n' '<h1>We buy records.</h1>\n' '\n' 'We are interested in purchase of USSR period records.\n' '<br><br>\n' '\n' 'E-mail:</td><td>a-p-a-t-r-i-d.ru@gmail.com (remove hyphens)\n' '\n' '{% endifequal %}\n' '</div>\n' '\n' '\n' '\n' '\n' '\n' '{% endblock %}') |
/home/aenv/lib/python3.10/site-packages/django/template/base.py
, line 200, in compile_nodelist
tokens,
self.engine.template_libraries,
self.engine.template_builtins,
self.origin,
)
try:
return parser.parse()…
except Exception as e:
if self.engine.debug:
e.template_debug = self.get_exception_info(e, e.token)
raise
def get_exception_info(self, exception, token):
Variable | Value |
---|---|
lexer | <DebugLexer template_string="{% extends "music/ba...", verbatim=False> |
parser | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
self | <Template template_string="{% extends "music/ba..."> |
tokens | [<Block token: "extends "music/base....">, <Text token: "...">, <Block token: "load i18n...">, <Text token: "...">, <Block token: "block title...">, <Block token: "trans 'Купим ваши пл...">, <Block token: "endblock...">, <Text token: "...">, <Block token: "block description...">, <Block token: "endblock...">, <Text token: "...">, <Block token: "block main...">, <Text token: "<div class="a...">, <Block token: "ifequal LANGUAGE_COD...">, <Text token: "<h1>Купим ваши пла...">, <Block token: "else...">, <Text token: "<h1>We buy records...">, <Block token: "endifequal...">, <Text token: "</div>...">, <Block token: "endblock...">] |
/home/aenv/lib/python3.10/site-packages/django/template/base.py
, line 513, in parse
except KeyError:
self.invalid_block_tag(token, command, parse_until)
# Compile the callback into a node object and add it to
# the node list.
try:
compiled_result = compile_func(self, token)
except Exception as e:
raise self.error(token, e)…
self.extend_nodelist(nodelist, compiled_result, token)
# Compile success. Remove the token from the command stack.
self.command_stack.pop()
if parse_until:
self.unclosed_block_tag(parse_until)
return nodelist
Variable | Value |
---|---|
command | 'extends' |
compile_func | <function do_extends at 0x7f1e27746290> |
nodelist | [] |
parse_until | [] |
self | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
token | <Block token: "extends "music/base...."> |
token_type | 2 |
/home/aenv/lib/python3.10/site-packages/django/template/base.py
, line 511, in parse
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
# Compile the callback into a node object and add it to
# the node list.
try:
compiled_result = compile_func(self, token)…
except Exception as e:
raise self.error(token, e)
self.extend_nodelist(nodelist, compiled_result, token)
# Compile success. Remove the token from the command stack.
self.command_stack.pop()
if parse_until:
Variable | Value |
---|---|
command | 'extends' |
compile_func | <function do_extends at 0x7f1e27746290> |
nodelist | [] |
parse_until | [] |
self | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
token | <Block token: "extends "music/base...."> |
token_type | 2 |
/home/aenv/lib/python3.10/site-packages/django/template/loader_tags.py
, line 293, in do_extends
the parent template itself (if it evaluates to a Template object).
"""
bits = token.split_contents()
if len(bits) != 2:
raise TemplateSyntaxError("'%s' takes one argument" % bits[0])
bits[1] = construct_relative_path(parser.origin.template_name, bits[1])
parent_name = 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)
Variable | Value |
---|---|
bits | ['extends', '"music/base.html"'] |
parent_name | <FilterExpression '"music/base.html"'> |
parser | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
token | <Block token: "extends "music/base...."> |
/home/aenv/lib/python3.10/site-packages/django/template/base.py
, line 513, in parse
except KeyError:
self.invalid_block_tag(token, command, parse_until)
# Compile the callback into a node object and add it to
# the node list.
try:
compiled_result = compile_func(self, token)
except Exception as e:
raise self.error(token, e)…
self.extend_nodelist(nodelist, compiled_result, token)
# Compile success. Remove the token from the command stack.
self.command_stack.pop()
if parse_until:
self.unclosed_block_tag(parse_until)
return nodelist
Variable | Value |
---|---|
command | 'block' |
compile_func | <function do_block at 0x7f1e27746170> |
compiled_result | <Block Node: description. Contents: []> |
nodelist | [<TextNode: '\n'>, <django.template.defaulttags.LoadNode object at 0x7f1e25dd6c50>, <TextNode: '\n\n'>, <Block Node: title. Contents: [<django.templatetags.i18n.TranslateNode object at 0x7f1e25dd5180>]>, <TextNode: '\n'>, <Block Node: description. Contents: []>, <TextNode: '\n\n'>] |
parse_until | [] |
self | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
token | <Block token: "block main..."> |
token_type | 2 |
/home/aenv/lib/python3.10/site-packages/django/template/base.py
, line 511, in parse
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)
# Compile the callback into a node object and add it to
# the node list.
try:
compiled_result = compile_func(self, token)…
except Exception as e:
raise self.error(token, e)
self.extend_nodelist(nodelist, compiled_result, token)
# Compile success. Remove the token from the command stack.
self.command_stack.pop()
if parse_until:
Variable | Value |
---|---|
command | 'block' |
compile_func | <function do_block at 0x7f1e27746170> |
compiled_result | <Block Node: description. Contents: []> |
nodelist | [<TextNode: '\n'>, <django.template.defaulttags.LoadNode object at 0x7f1e25dd6c50>, <TextNode: '\n\n'>, <Block Node: title. Contents: [<django.templatetags.i18n.TranslateNode object at 0x7f1e25dd5180>]>, <TextNode: '\n'>, <Block Node: description. Contents: []>, <TextNode: '\n\n'>] |
parse_until | [] |
self | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
token | <Block token: "block main..."> |
token_type | 2 |
/home/aenv/lib/python3.10/site-packages/django/template/loader_tags.py
, line 232, in do_block
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",))…
# This check is kept for backwards-compatibility. See #3100.
endblock = parser.next_token()
acceptable_endblocks = ("endblock", "endblock %s" % block_name)
if endblock.contents not in acceptable_endblocks:
parser.invalid_block_tag(endblock, "endblock", acceptable_endblocks)
Variable | Value |
---|---|
bits | ['block', 'main'] |
block_name | 'main' |
parser | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
token | <Block token: "block main..."> |
/home/aenv/lib/python3.10/site-packages/django/template/base.py
, line 507, in parse
# tag.
self.command_stack.append((command, token))
# Get the tag callback function from the ones registered with
# the parser.
try:
compile_func = self.tags[command]
except KeyError:
self.invalid_block_tag(token, command, parse_until)…
# Compile the callback into a node object and add it to
# the node list.
try:
compiled_result = compile_func(self, token)
except Exception as e:
raise self.error(token, e)
Variable | Value |
---|---|
command | 'ifequal' |
nodelist | [<TextNode: '\n\n\n\n\n\n\n<div class="articl'>] |
parse_until | ('endblock',) |
self | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
token | <Block token: "ifequal LANGUAGE_COD..."> |
token_type | 2 |
/home/aenv/lib/python3.10/site-packages/django/template/base.py
, line 558, in invalid_block_tag
e = TemplateSyntaxError(e)
if not hasattr(e, "token"):
e.token = token
return e
def invalid_block_tag(self, token, command, parse_until=None):
if parse_until:
raise self.error(…
token,
"Invalid block tag on line %d: '%s', expected %s. Did you "
"forget to register or load this tag?"
% (
token.lineno,
command,
Variable | Value |
---|---|
command | 'ifequal' |
parse_until | ('endblock',) |
self | <Parser tokens=[<Block token: "endblock...">, <Text token: "</div>...">, <Block token: "endifequal...">, <Text token: "<h1>We buy records...">, <Block token: "else...">, <Text token: "<h1>Купим ваши пла...">]> |
token | <Block token: "ifequal LANGUAGE_COD..."> |
AnonymousUser
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
CONTENT_LENGTH | '' |
CONTENT_TYPE | '' |
DOCUMENT_ROOT | '/usr/share/nginx/html' |
HTTP_ACCEPT | '*/*' |
HTTP_HOST | 'apatrid.ru' |
HTTP_USER_AGENT | 'claudebot' |
PATH_INFO | '/en/buy_records' |
QUERY_STRING | '' |
REMOTE_ADDR | '35.168.113.41' |
REMOTE_PORT | '38024' |
REQUEST_METHOD | 'GET' |
REQUEST_SCHEME | 'http' |
REQUEST_URI | '/en/buy_records' |
SCRIPT_NAME | '' |
SERVER_NAME | 'apatrid.ru' |
SERVER_PORT | '80' |
SERVER_PROTOCOL | 'HTTP/1.1' |
uwsgi.node | b'shu.fvds.ru' |
uwsgi.version | b'2.0.23' |
wsgi.errors | <_io.TextIOWrapper name=2 mode='w' encoding='UTF-8'> |
wsgi.file_wrapper | <built-in function uwsgi_sendfile> |
wsgi.input | <uwsgi._Input object at 0x7f1e25d2bf10> |
wsgi.multiprocess | True |
wsgi.multithread | False |
wsgi.run_once | False |
wsgi.url_scheme | 'http' |
wsgi.version | (1, 0) |
apatrid.settings
Setting | Value |
---|---|
ABSOLUTE_URL_OVERRIDES | {} |
ADMINS | [] |
ALLOWED_HOSTS | ['127.0.0.1', 'localhost', 'apatrid.ru', 'www.apatrid.ru'] |
APPEND_SLASH | True |
AUTHENTICATION_BACKENDS | ['django.contrib.auth.backends.ModelBackend'] |
AUTH_PASSWORD_VALIDATORS | '********************' |
AUTH_USER_MODEL | 'auth.User' |
BASE_DIR | PosixPath('/home/apatrid') |
CACHES | {'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} |
CACHE_MIDDLEWARE_ALIAS | 'default' |
CACHE_MIDDLEWARE_KEY_PREFIX | '********************' |
CACHE_MIDDLEWARE_SECONDS | 600 |
CSRF_COOKIE_AGE | 31449600 |
CSRF_COOKIE_DOMAIN | None |
CSRF_COOKIE_HTTPONLY | False |
CSRF_COOKIE_MASKED | False |
CSRF_COOKIE_NAME | 'csrftoken' |
CSRF_COOKIE_PATH | '/' |
CSRF_COOKIE_SAMESITE | 'Lax' |
CSRF_COOKIE_SECURE | False |
CSRF_FAILURE_VIEW | 'django.views.csrf.csrf_failure' |
CSRF_HEADER_NAME | 'HTTP_X_CSRFTOKEN' |
CSRF_TRUSTED_ORIGINS | [] |
CSRF_USE_SESSIONS | False |
DATABASES | {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_HEALTH_CHECKS': False, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.mysql', 'HOST': '', 'NAME': 'apatriddb', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'apatriddbuser'}} |
DATABASE_ROUTERS | [] |
DATA_UPLOAD_MAX_MEMORY_SIZE | 2621440 |
DATA_UPLOAD_MAX_NUMBER_FIELDS | 1000 |
DATA_UPLOAD_MAX_NUMBER_FILES | 100 |
DATETIME_FORMAT | 'N j, Y, P' |
DATETIME_INPUT_FORMATS | ['%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M'] |
DATE_FORMAT | 'N j, Y' |
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'] |
DEBUG | True |
DEBUG_PROPAGATE_EXCEPTIONS | False |
DECIMAL_SEPARATOR | '.' |
DEFAULT_AUTO_FIELD | 'django.db.models.BigAutoField' |
DEFAULT_CHARSET | 'utf-8' |
DEFAULT_EXCEPTION_REPORTER | 'django.views.debug.ExceptionReporter' |
DEFAULT_EXCEPTION_REPORTER_FILTER | 'django.views.debug.SafeExceptionReporterFilter' |
DEFAULT_FILE_STORAGE | 'django.core.files.storage.FileSystemStorage' |
DEFAULT_FROM_EMAIL | 'webmaster@localhost' |
DEFAULT_INDEX_TABLESPACE | '' |
DEFAULT_TABLESPACE | '' |
DISALLOWED_USER_AGENTS | [] |
EMAIL_BACKEND | 'django.core.mail.backends.smtp.EmailBackend' |
EMAIL_HOST | 'localhost' |
EMAIL_HOST_PASSWORD | '********************' |
EMAIL_HOST_USER | '' |
EMAIL_PORT | 25 |
EMAIL_SSL_CERTFILE | None |
EMAIL_SSL_KEYFILE | '********************' |
EMAIL_SUBJECT_PREFIX | '[Django] ' |
EMAIL_TIMEOUT | None |
EMAIL_USE_LOCALTIME | False |
EMAIL_USE_SSL | False |
EMAIL_USE_TLS | False |
FILE_UPLOAD_DIRECTORY_PERMISSIONS | None |
FILE_UPLOAD_HANDLERS | ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler'] |
FILE_UPLOAD_MAX_MEMORY_SIZE | 2621440 |
FILE_UPLOAD_PERMISSIONS | 420 |
FILE_UPLOAD_TEMP_DIR | None |
FIRST_DAY_OF_WEEK | 0 |
FIXTURE_DIRS | [] |
FORCE_SCRIPT_NAME | None |
FORMAT_MODULE_PATH | None |
FORM_RENDERER | 'django.forms.renderers.DjangoTemplates' |
IGNORABLE_404_URLS | [] |
INSTALLED_APPS | ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'music', 'modeltranslation'] |
INTERNAL_IPS | [] |
LANGUAGES | (('ru', 'Русский'), ('en', 'English')) |
LANGUAGES_BIDI | ['he', 'ar', 'ar-dz', 'ckb', 'fa', 'ur'] |
LANGUAGE_CODE | 'ru' |
LANGUAGE_COOKIE_AGE | None |
LANGUAGE_COOKIE_DOMAIN | None |
LANGUAGE_COOKIE_HTTPONLY | False |
LANGUAGE_COOKIE_NAME | 'django_language' |
LANGUAGE_COOKIE_PATH | '/' |
LANGUAGE_COOKIE_SAMESITE | None |
LANGUAGE_COOKIE_SECURE | False |
LOCALE_PATHS | ('/home/apatrid/locale', '/home/apatrid/') |
LOGGING | {} |
LOGGING_CONFIG | 'logging.config.dictConfig' |
LOGIN_REDIRECT_URL | '/accounts/profile/' |
LOGIN_URL | '/accounts/login/' |
LOGOUT_REDIRECT_URL | None |
MANAGERS | [] |
MEDIA_ROOT | '' |
MEDIA_URL | '/' |
MESSAGE_STORAGE | 'django.contrib.messages.storage.fallback.FallbackStorage' |
MIDDLEWARE | ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] |
MIGRATION_MODULES | {} |
MODELTRANSLATION_TRANSLATION_FILES | ('music.translation',) |
MONTH_DAY_FORMAT | 'F j' |
NUMBER_GROUPING | 0 |
PASSWORD_HASHERS | '********************' |
PASSWORD_RESET_TIMEOUT | '********************' |
PREPEND_WWW | False |
ROOT_URLCONF | 'apatrid.urls' |
SECRET_KEY | '********************' |
SECRET_KEY_FALLBACKS | '********************' |
SECURE_CONTENT_TYPE_NOSNIFF | True |
SECURE_CROSS_ORIGIN_OPENER_POLICY | 'same-origin' |
SECURE_HSTS_INCLUDE_SUBDOMAINS | False |
SECURE_HSTS_PRELOAD | False |
SECURE_HSTS_SECONDS | 0 |
SECURE_PROXY_SSL_HEADER | None |
SECURE_REDIRECT_EXEMPT | [] |
SECURE_REFERRER_POLICY | 'same-origin' |
SECURE_SSL_HOST | None |
SECURE_SSL_REDIRECT | False |
SERVER_EMAIL | 'root@localhost' |
SESSION_CACHE_ALIAS | 'default' |
SESSION_COOKIE_AGE | 1209600 |
SESSION_COOKIE_DOMAIN | None |
SESSION_COOKIE_HTTPONLY | True |
SESSION_COOKIE_NAME | 'sessionid' |
SESSION_COOKIE_PATH | '/' |
SESSION_COOKIE_SAMESITE | 'Lax' |
SESSION_COOKIE_SECURE | False |
SESSION_ENGINE | 'django.contrib.sessions.backends.db' |
SESSION_EXPIRE_AT_BROWSER_CLOSE | False |
SESSION_FILE_PATH | None |
SESSION_SAVE_EVERY_REQUEST | False |
SESSION_SERIALIZER | 'django.contrib.sessions.serializers.JSONSerializer' |
SETTINGS_MODULE | 'apatrid.settings' |
SHORT_DATETIME_FORMAT | 'm/d/Y P' |
SHORT_DATE_FORMAT | 'm/d/Y' |
SIGNING_BACKEND | 'django.core.signing.TimestampSigner' |
SILENCED_SYSTEM_CHECKS | [] |
STATICFILES_DIRS | [] |
STATICFILES_FINDERS | ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] |
STATICFILES_STORAGE | 'django.contrib.staticfiles.storage.StaticFilesStorage' |
STATIC_ROOT | None |
STATIC_URL | '/files/' |
STORAGES | {'default': {'BACKEND': 'django.core.files.storage.FileSystemStorage'}, 'staticfiles': {'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage'}} |
TEMPLATES | [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/home/apatrid/templates'], 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'music.context_processors.languages_list']}}] |
TEST_NON_SERIALIZED_APPS | [] |
TEST_RUNNER | 'django.test.runner.DiscoverRunner' |
THOUSAND_SEPARATOR | ',' |
TIME_FORMAT | 'P' |
TIME_INPUT_FORMATS | ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] |
TIME_ZONE | 'UTC' |
USE_DEPRECATED_PYTZ | False |
USE_I18N | True |
USE_L10N | True |
USE_THOUSAND_SEPARATOR | False |
USE_TZ | True |
USE_X_FORWARDED_HOST | False |
USE_X_FORWARDED_PORT | False |
WSGI_APPLICATION | 'apatrid.wsgi.application' |
X_FRAME_OPTIONS | 'DENY' |
YEAR_MONTH_FORMAT | 'F Y' |
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 page generated by the handler for this status code.