Could not parse the remainder: '=' from '='
Request Method: | GET |
---|---|
Request URL: | https://www.china-travel-guide.net/chinaairportlist/ |
Django Version: | 3.2.19 |
Exception Type: | TemplateSyntaxError |
Exception Value: | Could not parse the remainder: '=' from '=' |
Exception Location: | /app/.heroku/python/lib/python3.9/site-packages/django/template/base.py, line 662, in __init__ |
Python Executable: | /app/.heroku/python/bin/python |
Python Version: | 3.9.16 |
Python Path: | ['/app/.heroku/python/bin', '/app', '/app/.heroku/python/lib/python39.zip', '/app/.heroku/python/lib/python3.9', '/app/.heroku/python/lib/python3.9/lib-dynload', '/app/.heroku/python/lib/python3.9/site-packages', '/app/.heroku/python/lib/python3.9/site-packages/odf', '/app/.heroku/python/lib/python3.9/site-packages/odf', '/app/.heroku/python/lib/python3.9/site-packages/odf', '/app/.heroku/python/lib/python3.9/site-packages/odf', '/app/.heroku/python/lib/python3.9/site-packages/odf', '/app/.heroku/python/lib/python3.9/site-packages/odf', '/app/.heroku/python/lib/python3.9/site-packages/odf'] |
Server time: | Tue, 19 Mar 2024 06:30:36 +0000 |
In template /app/maincontent/templates/maincontent/airport_list.html
, error at line 29
19 | <section class="hero" style='background-image: url("https://s3.us-east-2.amazonaws.com/travelguidechi/images/airportbg.jpg")'></section> |
---|---|
20 | |
21 | {% include "iconsmenu.html" %} |
22 | |
23 | <div class="mainpanel"> |
24 | <h1 class="content-title">China Airports</h1> |
25 | |
26 | <p class="content-content">China is currently going on an airport-building spree, with almost 200 currently in use. That being said the smaller airports often have very limited services. Most international flights fly in via one of the first-tier city airports, although increasingly more fly to 2nd and 3rd tier cities. The domestic network is also well-developed, with thousands of different routes available and aking a domestic flight isn’t really any different than taking a flight anywhere else in the world. For longer distances in China, taking a flight is usually recommended over taking the high-speed train.</p> |
27 | <div class="allcityattractions"> |
28 | {% for airport in object_list %} |
29 | {% if airport.airport_status = 'In Operation' %} |
30 | <a href="{% url 'airport-detail' slug=airport.slug %}"> |
31 | <div class="card" style="padding-left:20px;padding-bottom:20px"> |
32 | <h3>{{ airport.airport_name_en }}</h3> |
33 | <a href="{% url 'airport-detail' slug=airport.slug %}">Read More</a> |
34 | </div> |
35 | </a> |
36 | {% endif %} |
37 | {% endfor %} |
38 | </div> |
39 | </div><br /> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/smartif.py
, line 175, in translate_token
self.tokens = mapped_tokens
self.pos = 0
self.current_token = self.next_token()
def translate_token(self, token):
try:
op = OPERATORS[token]…
except (KeyError, TypeError):
return self.create_var(token)
else:
return op()
def next_token(self):
Variable | Value |
---|---|
self | <django.template.defaulttags.TemplateIfParser object at 0x7f601b3b4130> |
token | '=' |
/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py
, line 47, in inner
response = await sync_to_async(response_for_exception, thread_sensitive=False)(request, exc)
return response
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("Could not parse the remainder: '=' from '='") |
get_response | <bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f6027b0f460>> |
request | <WSGIRequest: GET '/chinaairportlist/'> |
/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/base.py
, line 204, in _get_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 AllAirportsListView at 0x7f60276910d0> |
callback_args | () |
callback_kwargs | {} |
middleware_method | <function CsrfViewMiddleware.process_view at 0x7f60258da700> |
request | <WSGIRequest: GET '/chinaairportlist/'> |
response | None |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f6027b0f460> |
wrapped_callback | <function AllAirportsListView at 0x7f60276910d0> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/response.py
, line 105, 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"> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/response.py
, line 81, 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"> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/response.py
, line 63, 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 | ['maincontent/airport_list.html'] |
/app/.heroku/python/lib/python3.9/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 0x7f60275b7df0> |
engines | [<django.template.backends.django.DjangoTemplates object at 0x7f60275b7df0>] |
template_name | 'maincontent/airport_list.html' |
template_name_list | ['maincontent/airport_list.html'] |
using | None |
/app/.heroku/python/lib/python3.9/site-packages/django/template/backends/django.py
, line 34, 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 0x7f60275b7df0> |
template_name | 'maincontent/airport_list.html' |
/app/.heroku/python/lib/python3.9/site-packages/django/template/engine.py
, line 143, 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 | <django.template.engine.Engine object at 0x7f60275b7250> |
template_name | 'maincontent/airport_list.html' |
/app/.heroku/python/lib/python3.9/site-packages/django/template/engine.py
, line 125, in find_template
raise ImproperlyConfigured(
"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.app_directories.Loader object at 0x7f602763af10> |
name | 'maincontent/airport_list.html' |
self | <django.template.engine.Engine object at 0x7f60275b7250> |
skip | None |
tried | [] |
/app/.heroku/python/lib/python3.9/site-packages/django/template/loaders/base.py
, line 29, 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,
)
raise TemplateDoesNotExist(template_name, tried=tried)
def get_template_sources(self, template_name):
Variable | Value |
---|---|
contents | ('{% load static %}\n' '\n' '<!doctype html>\n' '<html lang="en">\n' '\n' ' <head>\n' ' <meta charset="utf-8">\n' ' <meta name="viewport" content="width=device-width, initial-scale=1, ' 'shrink-to-fit=no">\n' ' <meta name="description" content="Find information about all airports in ' 'China, including airlines, metro lines, opening year and general ' 'information.">\n' ' <meta name="keywords" content="china airports, china airport list, list ' 'of airports in china, biggest airports in china">\n' ' <title> List of All Airports in China | China-Travel-Guide.net </title>\n' ' {% include "headconstants.html" %}\n' ' </head>\n' '\n' ' <body>\n' '\n' ' {% include "nav.html" %}\n' '\n' ' <section class="hero" style=\'background-image: ' 'url("https://s3.us-east-2.amazonaws.com/travelguidechi/images/airportbg.jpg")\'></section>\n' '\n' ' {% include "iconsmenu.html" %}\n' '\n' ' <div class="mainpanel">\n' ' <h1 class="content-title">China Airports</h1>\n' '\n' ' <p class="content-content">China is currently going on an ' 'airport-building spree, with almost 200 currently in use. That being said ' 'the smaller airports often have very limited services. Most international ' 'flights fly in via one of the first-tier city airports, although ' 'increasingly more fly to 2nd and 3rd tier cities. The domestic network is ' 'also well-developed, with thousands of different routes available and aking ' 'a domestic flight isn’t really any different than taking a flight anywhere ' 'else in the world. For longer distances in China, taking a flight is usually ' 'recommended over taking the high-speed train.</p>\n' ' <div class="allcityattractions">\n' ' {% for airport in object_list %}\n' " {% if airport.airport_status = 'In Operation' %}\n" ' <a href="{% url \'airport-detail\' slug=airport.slug %}">\n' ' <div class="card" ' 'style="padding-left:20px;padding-bottom:20px">\n' ' <h3>{{ airport.airport_name_en }}</h3>\n' ' <a href="{% url \'airport-detail\' slug=airport.slug ' '%}">Read More</a>\n' ' </div>\n' ' </a>\n' ' {% endif %}\n' ' {% endfor %}\n' ' </div>\n' ' </div><br />\n' '\n' ' {% include "foot.html" %}\n' '\n' ' </body>\n' '</html>') |
origin | <django.template.base.Origin object at 0x7f60254f1490> |
self | <django.template.loaders.app_directories.Loader object at 0x7f602763af10> |
skip | None |
template_name | 'maincontent/airport_list.html' |
tried | [(<django.template.base.Origin object at 0x7f60254f18b0>, 'Source does not exist'), (<django.template.base.Origin object at 0x7f60254f1a00>, 'Source does not exist')] |
/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py
, line 155, 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 _render(self, context):
Variable | Value |
---|---|
engine | <django.template.engine.Engine object at 0x7f60275b7250> |
name | 'maincontent/airport_list.html' |
origin | <django.template.base.Origin object at 0x7f60254f1490> |
self | <django.template.base.Template object at 0x7f60254f1280> |
template_string | ('{% load static %}\n' '\n' '<!doctype html>\n' '<html lang="en">\n' '\n' ' <head>\n' ' <meta charset="utf-8">\n' ' <meta name="viewport" content="width=device-width, initial-scale=1, ' 'shrink-to-fit=no">\n' ' <meta name="description" content="Find information about all airports in ' 'China, including airlines, metro lines, opening year and general ' 'information.">\n' ' <meta name="keywords" content="china airports, china airport list, list ' 'of airports in china, biggest airports in china">\n' ' <title> List of All Airports in China | China-Travel-Guide.net </title>\n' ' {% include "headconstants.html" %}\n' ' </head>\n' '\n' ' <body>\n' '\n' ' {% include "nav.html" %}\n' '\n' ' <section class="hero" style=\'background-image: ' 'url("https://s3.us-east-2.amazonaws.com/travelguidechi/images/airportbg.jpg")\'></section>\n' '\n' ' {% include "iconsmenu.html" %}\n' '\n' ' <div class="mainpanel">\n' ' <h1 class="content-title">China Airports</h1>\n' '\n' ' <p class="content-content">China is currently going on an ' 'airport-building spree, with almost 200 currently in use. That being said ' 'the smaller airports often have very limited services. Most international ' 'flights fly in via one of the first-tier city airports, although ' 'increasingly more fly to 2nd and 3rd tier cities. The domestic network is ' 'also well-developed, with thousands of different routes available and aking ' 'a domestic flight isn’t really any different than taking a flight anywhere ' 'else in the world. For longer distances in China, taking a flight is usually ' 'recommended over taking the high-speed train.</p>\n' ' <div class="allcityattractions">\n' ' {% for airport in object_list %}\n' " {% if airport.airport_status = 'In Operation' %}\n" ' <a href="{% url \'airport-detail\' slug=airport.slug %}">\n' ' <div class="card" ' 'style="padding-left:20px;padding-bottom:20px">\n' ' <h3>{{ airport.airport_name_en }}</h3>\n' ' <a href="{% url \'airport-detail\' slug=airport.slug ' '%}">Read More</a>\n' ' </div>\n' ' </a>\n' ' {% endif %}\n' ' {% endfor %}\n' ' </div>\n' ' </div><br />\n' '\n' ' {% include "foot.html" %}\n' '\n' ' </body>\n' '</html>') |
/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py
, line 193, in compile_nodelist
tokens = lexer.tokenize()
parser = Parser(
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 | <django.template.base.DebugLexer object at 0x7f60254f1940> |
parser | <django.template.base.Parser object at 0x7f6019e46c40> |
self | <django.template.base.Template object at 0x7f60254f1280> |
tokens | [<django.template.base.Token object at 0x7f60254f1340>, <django.template.base.Token object at 0x7f60254f1d30>, <django.template.base.Token object at 0x7f60254f1250>, <django.template.base.Token object at 0x7f60254f11f0>, <django.template.base.Token object at 0x7f60254f1bb0>, <django.template.base.Token object at 0x7f60254f1c40>, <django.template.base.Token object at 0x7f60254f1dc0>, <django.template.base.Token object at 0x7f60254f1730>, <django.template.base.Token object at 0x7f60254f1e80>, <django.template.base.Token object at 0x7f60254f1640>, <django.template.base.Token object at 0x7f60254f1fd0>, <django.template.base.Token object at 0x7f60254f1130>, <django.template.base.Token object at 0x7f6019e467f0>, <django.template.base.Token object at 0x7f6019e466d0>, <django.template.base.Token object at 0x7f6019e46f10>, <django.template.base.Token object at 0x7f6019e46d30>, <django.template.base.Token object at 0x7f6019e46af0>, <django.template.base.Token object at 0x7f6019e46ca0>, <django.template.base.Token object at 0x7f6019e46190>, <django.template.base.Token object at 0x7f6019e46e80>, <django.template.base.Token object at 0x7f6019e468e0>, <django.template.base.Token object at 0x7f6019e46a60>, <django.template.base.Token object at 0x7f6019e46f40>, <django.template.base.Token object at 0x7f60254f1a60>] |
/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py
, line 478, 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 | 'for' |
compile_func | <function do_for at 0x7f6028875310> |
compiled_result | <django.template.loader_tags.IncludeNode object at 0x7f601b3b49d0> |
nodelist | [<django.template.defaulttags.LoadNode object at 0x7f6019e46340>, <TextNode: '\n\n<!doctype html>\n<html l'>, <django.template.loader_tags.IncludeNode object at 0x7f6019e46ac0>, <TextNode: '\n </head>\n\n <body>\n\n '>, <django.template.loader_tags.IncludeNode object at 0x7f602762a490>, <TextNode: '\n\n <section class="h'>, <django.template.loader_tags.IncludeNode object at 0x7f601b3b49d0>, <TextNode: '\n\n <div class="m'>] |
parse_until | [] |
self | <django.template.base.Parser object at 0x7f6019e46c40> |
token | <django.template.base.Token object at 0x7f60254f1e80> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py
, line 476, 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 | 'for' |
compile_func | <function do_for at 0x7f6028875310> |
compiled_result | <django.template.loader_tags.IncludeNode object at 0x7f601b3b49d0> |
nodelist | [<django.template.defaulttags.LoadNode object at 0x7f6019e46340>, <TextNode: '\n\n<!doctype html>\n<html l'>, <django.template.loader_tags.IncludeNode object at 0x7f6019e46ac0>, <TextNode: '\n </head>\n\n <body>\n\n '>, <django.template.loader_tags.IncludeNode object at 0x7f602762a490>, <TextNode: '\n\n <section class="h'>, <django.template.loader_tags.IncludeNode object at 0x7f601b3b49d0>, <TextNode: '\n\n <div class="m'>] |
parse_until | [] |
self | <django.template.base.Parser object at 0x7f6019e46c40> |
token | <django.template.base.Token object at 0x7f60254f1e80> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/defaulttags.py
, line 817, in do_for
loopvars = re.split(r' *, *', ' '.join(bits[1:in_index]))
for var in loopvars:
if not var or not invalid_chars.isdisjoint(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 |
---|---|
bits | ['for', 'airport', 'in', 'object_list'] |
in_index | -2 |
invalid_chars | frozenset({' ', "'", '"', '|'}) |
is_reversed | False |
loopvars | ['airport'] |
parser | <django.template.base.Parser object at 0x7f6019e46c40> |
sequence | <django.template.base.FilterExpression object at 0x7f601b3b4160> |
token | <django.template.base.Token object at 0x7f60254f1e80> |
var | 'airport' |
/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py
, line 478, 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 | 'if' |
compile_func | <function do_if at 0x7f6028875820> |
nodelist | [<TextNode: '\n '>] |
parse_until | ('empty', 'endfor') |
self | <django.template.base.Parser object at 0x7f6019e46c40> |
token | <django.template.base.Token object at 0x7f60254f1fd0> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py
, line 476, 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 | 'if' |
compile_func | <function do_if at 0x7f6028875820> |
nodelist | [<TextNode: '\n '>] |
parse_until | ('empty', 'endfor') |
self | <django.template.base.Parser object at 0x7f6019e46c40> |
token | <django.template.base.Token object at 0x7f60254f1fd0> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/defaulttags.py
, line 967, in do_if
All supported operators are: ``or``, ``and``, ``in``, ``not in``
``==``, ``!=``, ``>``, ``>=``, ``<`` and ``<=``.
Operator precedence follows Python.
"""
# {% if ... %}
bits = token.split_contents()[1:]
condition = TemplateIfParser(parser, bits).parse()…
nodelist = parser.parse(('elif', 'else', 'endif'))
conditions_nodelists = [(condition, nodelist)]
token = parser.next_token()
# {% elif ... %} (repeatable)
while token.contents.startswith('elif'):
Variable | Value |
---|---|
bits | ['airport.airport_status', '=', "'In Operation'"] |
parser | <django.template.base.Parser object at 0x7f6019e46c40> |
token | <django.template.base.Token object at 0x7f60254f1fd0> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/defaulttags.py
, line 900, in __init__
class TemplateIfParser(IfParser):
error_class = TemplateSyntaxError
def __init__(self, parser, *args, **kwargs):
self.template_parser = parser
super().__init__(*args, **kwargs)…
def create_var(self, value):
return TemplateLiteral(self.template_parser.compile_filter(value), value)
@register.tag('if')
Variable | Value |
---|---|
__class__ | <class 'django.template.defaulttags.TemplateIfParser'> |
args | (['airport.airport_status', '=', "'In Operation'"],) |
kwargs | {} |
parser | <django.template.base.Parser object at 0x7f6019e46c40> |
self | <django.template.defaulttags.TemplateIfParser object at 0x7f601b3b4130> |
/app/.heroku/python/lib/python3.9/site-packages/django/template/smartif.py
, line 166, in __init__
token = tokens[i]
if token == "is" and i + 1 < num_tokens and tokens[i + 1] == "not":
token = "is not"
i += 1 # skip 'not'
elif token == "not" and i + 1 < num_tokens and tokens[i + 1] == "in":
token = "not in"
i += 1 # skip 'in'
mapped_tokens.append(self.translate_token(token))…
i += 1
self.tokens = mapped_tokens
self.pos = 0
self.current_token = self.next_token()
Variable | Value |
---|---|
i | 1 |
mapped_tokens | [(literal <django.template.base.FilterExpression object at 0x7f601b3b49a0>)] |
num_tokens | 3 |
self | <django.template.defaulttags.TemplateIfParser object at 0x7f601b3b4130> |
token | '=' |
tokens | ['airport.airport_status', '=', "'In Operation'"] |
/app/.heroku/python/lib/python3.9/site-packages/django/template/smartif.py
, line 177, in translate_token
self.pos = 0
self.current_token = self.next_token()
def translate_token(self, token):
try:
op = OPERATORS[token]
except (KeyError, TypeError):
return self.create_var(token)…
else:
return op()
def next_token(self):
if self.pos >= len(self.tokens):
return EndToken
Variable | Value |
---|---|
self | <django.template.defaulttags.TemplateIfParser object at 0x7f601b3b4130> |
token | '=' |
/app/.heroku/python/lib/python3.9/site-packages/django/template/defaulttags.py
, line 903, in create_var
error_class = TemplateSyntaxError
def __init__(self, parser, *args, **kwargs):
self.template_parser = parser
super().__init__(*args, **kwargs)
def create_var(self, value):
return TemplateLiteral(self.template_parser.compile_filter(value), value)…
@register.tag('if')
def do_if(parser, token):
"""
Evaluate a variable, and if that variable is "true" (i.e., exists, is not
Variable | Value |
---|---|
self | <django.template.defaulttags.TemplateIfParser object at 0x7f601b3b4130> |
value | '=' |
/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py
, line 563, in compile_filter
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 |
---|---|
self | <django.template.base.Parser object at 0x7f6019e46c40> |
token | '=' |
/app/.heroku/python/lib/python3.9/site-packages/django/template/base.py
, line 662, in __init__
elif var_arg:
args.append((True, Variable(var_arg)))
filter_func = parser.find_filter(filter_name)
self.args_check(filter_name, filter_func, args)
filters.append((filter_func, args))
upto = match.end()
if upto != len(token):
raise TemplateSyntaxError("Could not parse the remainder: '%s' "…
"from '%s'" % (token[upto:], token))
self.filters = filters
self.var = var_obj
def resolve(self, context, ignore_failures=False):
Variable | Value |
---|---|
filters | [] |
matches | <callable_iterator object at 0x7f601b3b4e50> |
parser | <django.template.base.Parser object at 0x7f6019e46c40> |
self | <django.template.base.FilterExpression object at 0x7f601b3b4070> |
token | '=' |
upto | 0 |
var_obj | None |
AnonymousUser
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
HTTP_ACCEPT | '*/*' |
HTTP_CONNECTION | 'close' |
HTTP_CONNECT_TIME | '0' |
HTTP_HOST | 'www.china-travel-guide.net' |
HTTP_TOTAL_ROUTE_TIME | '0' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_VIA | '1.1 vegur' |
HTTP_X_FORWARDED_FOR | '54.160.244.62' |
HTTP_X_FORWARDED_PORT | '443' |
HTTP_X_FORWARDED_PROTO | 'https' |
HTTP_X_REQUEST_ID | '931cf5b9-e149-4c3e-9891-7ddd7edf9e24' |
HTTP_X_REQUEST_START | '1710829836195' |
PATH_INFO | '/chinaairportlist/' |
QUERY_STRING | '' |
RAW_URI | '/chinaairportlist/' |
REMOTE_ADDR | '10.1.17.91' |
REMOTE_PORT | '16689' |
REQUEST_METHOD | 'GET' |
SCRIPT_NAME | '' |
SERVER_NAME | '0.0.0.0' |
SERVER_PORT | '9990' |
SERVER_PROTOCOL | 'HTTP/1.1' |
SERVER_SOFTWARE | 'gunicorn/19.8.1' |
gunicorn.socket | <socket.socket fd=11, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('172.19.87.126', 9990), raddr=('10.1.17.91', 16689)> |
wsgi.errors | <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f60276283a0> |
wsgi.file_wrapper | <class 'gunicorn.http.wsgi.FileWrapper'> |
wsgi.input | <gunicorn.http.body.Body object at 0x7f60276287c0> |
wsgi.multiprocess | True |
wsgi.multithread | False |
wsgi.run_once | False |
wsgi.url_scheme | 'https' |
wsgi.version | (1, 0) |
travelsite.settings
Setting | Value |
---|---|
ABSOLUTE_URL_OVERRIDES | {} |
ADMINS | [] |
ALLOWED_HOSTS | ['www.china-travel-guide.net'] |
APPEND_SLASH | True |
AUTHENTICATION_BACKENDS | ['django.contrib.auth.backends.ModelBackend'] |
AUTH_PASSWORD_VALIDATORS | '********************' |
AUTH_USER_MODEL | 'auth.User' |
AWS_ACCESS_KEY_ID | '********************' |
AWS_S3_CUSTOM_DOMAIN | 's3.us-east-2.amazonaws.com/travelguidechi' |
AWS_S3_OBJECT_PARAMETERS | {'CacheControl': 'max-age=94608000', 'Expires': 'Thu, 31 Dec 2099 20:00:00 GMT'} |
AWS_S3_REGION_NAME | 'us-east-2' |
AWS_SECRET_ACCESS_KEY | '********************' |
AWS_STORAGE_BUCKET_NAME | 'travelguidechi' |
BASE_DIR | '/app' |
CACHES | {'default': {'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', 'LOCATION': '128.199.222.144:11211'}} |
CACHE_MIDDLEWARE_ALIAS | 'default' |
CACHE_MIDDLEWARE_KEY_PREFIX | '********************' |
CACHE_MIDDLEWARE_SECONDS | 600 |
CELERY_BROKER_URL | 'amqp://localhost' |
CSRF_COOKIE_AGE | 31449600 |
CSRF_COOKIE_DOMAIN | None |
CSRF_COOKIE_HTTPONLY | False |
CSRF_COOKIE_NAME | 'csrftoken' |
CSRF_COOKIE_PATH | '/' |
CSRF_COOKIE_SAMESITE | 'Lax' |
CSRF_COOKIE_SECURE | True |
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_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'HOST': 'ec2-44-194-4-127.compute-1.amazonaws.com', 'NAME': 'd4pt2prg4ttlen', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': 5432, 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'jhmavnkazuksei'}} |
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.AutoField' |
DEFAULT_CHARSET | 'utf-8' |
DEFAULT_EXCEPTION_REPORTER | 'django.views.debug.ExceptionReporter' |
DEFAULT_EXCEPTION_REPORTER_FILTER | 'django.views.debug.SafeExceptionReporterFilter' |
DEFAULT_FILE_STORAGE | 'storages.backends.s3boto3.S3Boto3Storage' |
DEFAULT_FROM_EMAIL | 'webmaster@localhost' |
DEFAULT_HASHING_ALGORITHM | 'sha256' |
DEFAULT_INDEX_TABLESPACE | '' |
DEFAULT_TABLESPACE | '' |
DISALLOWED_USER_AGENTS | [] |
EASY_MAPS_GOOGLE_MAPS_API_KEY | '********************' |
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 | [] |
IMPORT_EXPORT_USE_TRANSACTIONS | True |
INSTALLED_APPS | ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'maincontent', 'django.contrib.humanize', 'django.contrib.sitemaps', 'django.contrib.sites', 's3direct', 'storages', 'import_export', 'robots', 'haversine', 'debug_toolbar') |
INTERNAL_IPS | ['180.150.112.207'] |
LANGUAGES | [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ar-dz', 'Algerian Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('hy', 'Armenian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('ig', 'Igbo'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('ky', 'Kyrgyz'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokmål'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('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'), ('sw', 'Swahili'), ('ta', 'Tamil'), ('te', 'Telugu'), ('tg', 'Tajik'), ('th', 'Thai'), ('tk', 'Turkmen'), ('tr', 'Turkish'), ('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('uz', 'Uzbek'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')] |
LANGUAGES_BIDI | ['he', 'ar', 'ar-dz', 'fa', 'ur'] |
LANGUAGE_CODE | 'en-us' |
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 | [] |
LOGGING | {'disable_existing_loggers': False, 'handlers': {'console': {'class': 'logging.StreamHandler'}}, 'root': {'handlers': ['console'], 'level': 'ERROR'}, 'version': 1} |
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.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware') |
MIGRATION_MODULES | {} |
MONTH_DAY_FORMAT | 'F j' |
NUMBER_GROUPING | 0 |
PASSWORD_HASHERS | '********************' |
PASSWORD_RESET_TIMEOUT | '********************' |
PASSWORD_RESET_TIMEOUT_DAYS | '********************' |
PREPEND_WWW | False |
PROJECT_ROOT | '/app/travelsite' |
ROOT_URLCONF | 'travelsite.urls' |
S3DIRECT_DESTINATIONS | {'ctgcitys3': {'allowed': ['image/jpeg', 'image/png', 'video/mp4'], 'cache_control': 'max-age=2592000', 'content_disposition': 'attachment', 'content_length_range': (5000, 20000000), 'key': '********************', 'server_side_encryption': 'AES256'}, 'ctgs3': {'allowed': ['image/jpeg', 'image/png', 'video/mp4'], 'cache_control': 'max-age=2592000', 'content_disposition': 'attachment', 'content_length_range': (5000, 20000000), 'key': '********************', 'server_side_encryption': 'AES256'}, 'genericarticle': {'allowed': ['image/jpeg', 'image/png', 'video/mp4'], 'cache_control': 'max-age=2592000', 'content_disposition': 'attachment', 'content_length_range': (5000, 20000000), 'key': '********************', 'server_side_encryption': 'AES256'}} |
S3DIRECT_REGION | 'us-east-2' |
SECRET_KEY | '********************' |
SECURE_BROWSER_XSS_FILTER | False |
SECURE_CONTENT_TYPE_NOSNIFF | True |
SECURE_HSTS_INCLUDE_SUBDOMAINS | False |
SECURE_HSTS_PRELOAD | False |
SECURE_HSTS_SECONDS | 0 |
SECURE_PROXY_SSL_HEADER | ('HTTP_X_FORWARDED_PROTO', 'https') |
SECURE_REDIRECT_EXEMPT | [] |
SECURE_REFERRER_POLICY | 'same-origin' |
SECURE_SSL_HOST | None |
SECURE_SSL_REDIRECT | True |
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 | True |
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 | 'travelsite.settings' |
SHORT_DATETIME_FORMAT | 'm/d/Y P' |
SHORT_DATE_FORMAT | 'm/d/Y' |
SIGNING_BACKEND | 'django.core.signing.TimestampSigner' |
SILENCED_SYSTEM_CHECKS | [] |
SITE_ID | 1 |
STATICFILES_DIRS | ('/app/travelsite/static',) |
STATICFILES_FINDERS | ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] |
STATICFILES_STORAGE | 'storages.backends.s3boto3.S3Boto3Storage' |
STATIC_ROOT | '/app/travelsite/staticfiles' |
STATIC_URL | 'https://s3.us-east-2.amazonaws.com/travelguidechi/' |
TEMPLATES | [{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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']}}] |
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_I18N | True |
USE_L10N | True |
USE_THOUSAND_SEPARATOR | False |
USE_TZ | True |
USE_X_FORWARDED_HOST | False |
USE_X_FORWARDED_PORT | False |
WSGI_APPLICATION | 'travelsite.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.