Caught TypeError while rendering: object of type 'NoneType' has no len()
Request Method: | GET |
---|---|
Request URL: | http://business.site-digger.com/business/32555a38307058796864773d/ |
Django Version: | 1.3.1 |
Exception Type: | TemplateSyntaxError |
Exception Value: | Caught TypeError while rendering: object of type 'NoneType' has no len() |
Exception Location: | /var/www/clients/client1/web7/web/yellowpage/filter/templatetags/custom.py in truncate_chars, line 22 |
Python Executable: | /usr/bin/python |
Python Version: | 2.7.6 |
Python Path: | ['/usr/local/lib/python2.7/dist-packages/PIL-1.1.7-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/pyDes-2.0.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/crypto-1.1.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/Naked-0.1.30-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/PyYAML-3.11-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/pycrypto-2.6.1-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/PyAMF-0.8.0-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/defusedxml-0.4.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/Paste-2.0.3-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/shadowsocks-2.8.2-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pip-19.0.3-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/home/qi/python', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode', '/var/www/clients/client1/web7/web', '/var/www/clients/client1/web7/web/yellowpage'] |
Server time: | Sat, 30 Mar 2024 00:58:28 -0500 |
In template /var/www/clients/client1/web7/web/yellowpage/templates/details.html
, error at line 27
17 | <li><b>省份:</b>{{business.province }}</li> |
---|---|
18 | <li><b>城市:</b>{{business.city }}</li> |
19 | <li><b>城区:</b>{{business.area }}</li> |
20 | <li><b>电话:</b>{{business.contact_phone|default:business.telephone}}</li> |
21 | <li><b>地址:</b>{{business.address }}</li> |
22 | <!--<li><b>联系人:</b>{{business.contact_people }}</li> |
23 | <li><b>网站:</b>{{business.website }}</li> |
24 | <li><b>邮箱:</b>{{business.email }}</li>--> |
25 | <li><b>产品:</b>{{business.product }}</li> |
26 | <li><b>经度:</b>{{business.longitude }}</li> |
27 | <li><b>纬度:</b><a href="http://www.site-digger.com" title="联系网站客服查看完整信息" target="_blank">{{business.latitude|truncate_chars:5}}(联系网站客服查看完整信息)</a></li> |
28 | </ul> |
29 | </div> |
30 | <div class="map"> |
31 | <p style="margin:10px auto; font-weight:bold;">简介:</p> |
32 | {{business.description|linebreaks }} |
33 | </div> |
34 | {% endblock %} |
/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py
in get_response
for middleware_method in self._view_middleware:
response = middleware_method(request, callback, callback_args, callback_kwargs)
if response:
break
if response is None:
try:
response = callback(request, *callback_args, **callback_kwargs)...
except Exception, e:
# If the view raised an exception, run it through exception
# middleware, and if the exception middleware returns a
# response, use that. Otherwise, reraise the exception.
for middleware_method in self._exception_middleware:
response = middleware_method(request, e)
Variable | Value |
---|---|
exceptions | <module 'django.core.exceptions' from '/usr/local/lib/python2.7/dist-packages/django/core/exceptions.pyc'> |
e | TemplateSyntaxError(u"Caught TypeError while rendering: object of type 'NoneType' has no len()",) |
callback_args | (u'32555a38307058796864773d',) |
receivers | [(<function _rollback_on_exception at 0x7f8e0f43c6e0>, None)] |
middleware_method | <bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7f8e0f505e50>> |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f8e0f4f4310> |
settings | <django.conf.LazySettings object at 0x7f8e0f60d510> |
request | <WSGIRequest GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{}, META:{'CONTEXT_DOCUMENT_ROOT': '/var/www/business.site-digger.com/web', 'CONTEXT_PREFIX': '', 'CSRF_COOKIE': 'c810ce97b3af87dc0a3e069711fba532', 'DOCUMENT_ROOT': '/var/www/business.site-digger.com/web', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': '*/*', 'HTTP_HOST': 'business.site-digger.com', 'HTTP_USER_AGENT': 'claudebot', 'PATH_INFO': u'/business/32555a38307058796864773d/', 'PATH_TRANSLATED': '/var/www/clients/client1/web7/web/django.wsgi/business/32555a38307058796864773d/', 'QUERY_STRING': '', 'REMOTE_ADDR': '54.224.52.210', 'REMOTE_PORT': '46058', 'REQUEST_METHOD': 'GET', 'REQUEST_SCHEME': 'http', 'REQUEST_URI': '/business/32555a38307058796864773d/', 'SCRIPT_FILENAME': '/var/www/clients/client1/web7/web/django.wsgi', 'SCRIPT_NAME': u'', 'SERVER_ADDR': '47.90.32.133', 'SERVER_ADMIN': 'webmaster@business.site-digger.com', 'SERVER_NAME': 'business.site-digger.com', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SIGNATURE': '<address>Apache/2.4.7 (Ubuntu) Server at business.site-digger.com Port 80</address>\n', 'SERVER_SOFTWARE': 'Apache/2.4.7 (Ubuntu)', 'mod_wsgi.application_group': 'business.site-digger.com|', 'mod_wsgi.callable_object': 'application', 'mod_wsgi.enable_sendfile': '0', 'mod_wsgi.handler_script': '', 'mod_wsgi.input_chunked': '0', 'mod_wsgi.listener_host': '', 'mod_wsgi.listener_port': '80', 'mod_wsgi.process_group': '', 'mod_wsgi.queue_start': '1711778308920230', 'mod_wsgi.request_handler': 'wsgi-script', 'mod_wsgi.script_reloading': '1', 'mod_wsgi.version': (3, 4), 'wsgi.errors': <mod_wsgi.Log object at 0x7f8e0ceaa770>, 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f8e0ce59120>, 'wsgi.input': <mod_wsgi.Input object at 0x7f8e0ceaab70>, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> |
callback | <function business_detail at 0x7f8e0eb5ab18> |
resolver | <RegexURLResolver yellowpage.urls (None:None) ^/> |
urlresolvers | <module 'django.core.urlresolvers' from '/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.pyc'> |
callback_kwargs | {} |
response | None |
urlconf | 'yellowpage.urls' |
/var/www/clients/client1/web7/web/yellowpage/views.py
in business_detail
"""
fid = decode(fid)
try:
business = Business.objects.get(pk=fid)
except Business.DoesNotExist:
return HttpResponseRedirect('http://www.site-digger.com')
return render_to_response('details.html', locals())...
def sitemap(request):
"""站点地图
"""
start = random.randint(0, Business.objects.count())
businesses = Business.objects.order_by('pk')[start:start+500]
Variable | Value |
---|---|
request | <WSGIRequest GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{}, META:{'CONTEXT_DOCUMENT_ROOT': '/var/www/business.site-digger.com/web', 'CONTEXT_PREFIX': '', 'CSRF_COOKIE': 'c810ce97b3af87dc0a3e069711fba532', 'DOCUMENT_ROOT': '/var/www/business.site-digger.com/web', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': '*/*', 'HTTP_HOST': 'business.site-digger.com', 'HTTP_USER_AGENT': 'claudebot', 'PATH_INFO': u'/business/32555a38307058796864773d/', 'PATH_TRANSLATED': '/var/www/clients/client1/web7/web/django.wsgi/business/32555a38307058796864773d/', 'QUERY_STRING': '', 'REMOTE_ADDR': '54.224.52.210', 'REMOTE_PORT': '46058', 'REQUEST_METHOD': 'GET', 'REQUEST_SCHEME': 'http', 'REQUEST_URI': '/business/32555a38307058796864773d/', 'SCRIPT_FILENAME': '/var/www/clients/client1/web7/web/django.wsgi', 'SCRIPT_NAME': u'', 'SERVER_ADDR': '47.90.32.133', 'SERVER_ADMIN': 'webmaster@business.site-digger.com', 'SERVER_NAME': 'business.site-digger.com', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SIGNATURE': '<address>Apache/2.4.7 (Ubuntu) Server at business.site-digger.com Port 80</address>\n', 'SERVER_SOFTWARE': 'Apache/2.4.7 (Ubuntu)', 'mod_wsgi.application_group': 'business.site-digger.com|', 'mod_wsgi.callable_object': 'application', 'mod_wsgi.enable_sendfile': '0', 'mod_wsgi.handler_script': '', 'mod_wsgi.input_chunked': '0', 'mod_wsgi.listener_host': '', 'mod_wsgi.listener_port': '80', 'mod_wsgi.process_group': '', 'mod_wsgi.queue_start': '1711778308920230', 'mod_wsgi.request_handler': 'wsgi-script', 'mod_wsgi.script_reloading': '1', 'mod_wsgi.version': (3, 4), 'wsgi.errors': <mod_wsgi.Log object at 0x7f8e0ceaa770>, 'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f8e0ce59120>, 'wsgi.input': <mod_wsgi.Input object at 0x7f8e0ceaab70>, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> |
fid | '1457050' |
business | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py
in render_to_response
def render_to_response(*args, **kwargs):
"""
Returns a HttpResponse whose content is filled with the result of calling
django.template.loader.render_to_string() with the passed arguments.
"""
httpresponse_kwargs = {'mimetype': kwargs.pop('mimetype', None)}
return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)...
def render(request, *args, **kwargs):
"""
Returns a HttpResponse whose content is filled with the result of calling
django.template.loader.render_to_string() with the passed arguments.
Uses a RequestContext by default.
Variable | Value |
---|---|
httpresponse_kwargs | {'mimetype': None} |
args | Error in formatting: 'Business' object has no attribute 'name' |
kwargs | {} |
/usr/local/lib/python2.7/dist-packages/django/template/loader.py
in render_to_string
"""
dictionary = dictionary or {}
if isinstance(template_name, (list, tuple)):
t = select_template(template_name)
else:
t = get_template(template_name)
if not context_instance:
return t.render(Context(dictionary))...
# Add the dictionary to the context stack, ensuring it gets removed again
# to keep the context_instance in the same state it started in.
context_instance.update(dictionary)
try:
return t.render(context_instance)
finally:
Variable | Value |
---|---|
template_name | 'details.html' |
t | <django.template.base.Template object at 0x7f8e0cd84dd0> |
dictionary | Error in formatting: 'Business' object has no attribute 'name' |
context_instance | None |
/usr/local/lib/python2.7/dist-packages/django/template/base.py
in render
def _render(self, context):
return self.nodelist.render(context)
def render(self, context):
"Display stage -- can be called many times"
context.render_context.push()
try:
return self._render(context)...
finally:
context.render_context.pop()
def compile_string(template_string, origin):
"Compiles template_string into NodeList ready for rendering"
if settings.TEMPLATE_DEBUG:
Variable | Value |
---|---|
self | <django.template.base.Template object at 0x7f8e0cd84dd0> |
context | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/template/base.py
in _render
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
def _render(self, context):
return self.nodelist.render(context)...
def render(self, context):
"Display stage -- can be called many times"
context.render_context.push()
try:
return self._render(context)
Variable | Value |
---|---|
self | <django.template.base.Template object at 0x7f8e0cd84dd0> |
context | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/template/base.py
in render
# extend_nodelist().
contains_nontext = False
def render(self, context):
bits = []
for node in self:
if isinstance(node, Node):
bits.append(self.render_node(node, context))...
else:
bits.append(node)
return mark_safe(''.join([force_unicode(b) for b in bits]))
def get_nodes_by_type(self, nodetype):
"Return a list of all nodes of the given type"
Variable | Value |
---|---|
node | <ExtendsNode: extends "base.html"> |
self | [<ExtendsNode: extends "base.html">] |
bits | [] |
context | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/template/debug.py
in render_node
def compile_function_error(self, token, e):
if not hasattr(e, 'source'):
e.source = token.source
class DebugNodeList(NodeList):
def render_node(self, node, context):
try:
result = node.render(context)...
except TemplateSyntaxError, e:
if not hasattr(e, 'source'):
e.source = node.source
raise
except Exception, e:
from sys import exc_info
Variable | Value |
---|---|
node | <ExtendsNode: extends "base.html"> |
self | [<ExtendsNode: extends "base.html">] |
e | TemplateSyntaxError(u"Caught TypeError while rendering: object of type 'NoneType' has no len()",) |
context | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py
in render
blocks = dict([(n.name, n) for n in
compiled_parent.nodelist.get_nodes_by_type(BlockNode)])
block_context.add_blocks(blocks)
break
# Call Template._render explicitly so the parser context stays
# the same.
return compiled_parent._render(context)...
class BaseIncludeNode(Node):
def __init__(self, *args, **kwargs):
self.extra_context = kwargs.pop('extra_context', {})
self.isolated_context = kwargs.pop('isolated_context', False)
super(BaseIncludeNode, self).__init__(*args, **kwargs)
Variable | Value |
---|---|
node | <Block Node: title. Contents: []> |
blocks | {u'jscss': <Block Node: jscss. Contents: []>, u'main': <Block Node: main. Contents: []>, u'meta': <Block Node: meta. Contents: []>, u'title': <Block Node: title. Contents: []>} |
block_context | <django.template.loader_tags.BlockContext object at 0x7f8e0cd84590> |
n | <Block Node: main. Contents: []> |
context | Error in formatting: 'Business' object has no attribute 'name' |
compiled_parent | <django.template.base.Template object at 0x7f8e0ce60ad0> |
self | <ExtendsNode: extends "base.html"> |
/usr/local/lib/python2.7/dist-packages/django/template/base.py
in _render
def __iter__(self):
for node in self.nodelist:
for subnode in node:
yield subnode
def _render(self, context):
return self.nodelist.render(context)...
def render(self, context):
"Display stage -- can be called many times"
context.render_context.push()
try:
return self._render(context)
Variable | Value |
---|---|
self | <django.template.base.Template object at 0x7f8e0ce60ad0> |
context | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/template/base.py
in render
# extend_nodelist().
contains_nontext = False
def render(self, context):
bits = []
for node in self:
if isinstance(node, Node):
bits.append(self.render_node(node, context))...
else:
bits.append(node)
return mark_safe(''.join([force_unicode(b) for b in bits]))
def get_nodes_by_type(self, nodetype):
"Return a list of all nodes of the given type"
Variable | Value |
---|---|
node | <Block Node: main. Contents: []> |
self | [<Text Node: '<!DOCTYPE html PUBLIC "-/'>, <Block Node: title. Contents: []>, <Text Node: ' - ???? - By ??Web???????'>, <Block Node: meta. Contents: []>, <Text Node: ' <link rel="stylesheet" t'>, <Block Node: jscss. Contents: []>, <Text Node: ' </head> <body> <div id='>, <Block Node: main. Contents: []>, <Text Node: ' </div> <div style='>] |
bits | [u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n<title>', u'\u5e74\u8f6e\u9152\u574a\u53cb\u8c0a\u8def\u5e97-\u4e94\u5bb6\u6e20\u9ec4\u9875', u' - \u9cb2\u9e4f\u9ec4\u9875 - By \u9cb2\u9e4fWeb\u6570\u636e\u6293\u53d6\uff08\u91c7\u96c6\uff09</title>\n', u'\r\n<meta name="keywords" content="\u5e74\u8f6e\u9152\u574a\u53cb\u8c0a\u8def\u5e97,None,\u4e94\u5bb6\u6e20\u9ec4\u9875,\u7f8e\u98df\u6c47,\u9cb2\u9e4f\u6570\u636e,\u6570\u636e\u6293\u53d6,\u6570\u636e\u91c7\u96c6,site-digger.com" />\r\n<meta name="description" content="\u5e74\u8f6e\u9152\u574a\u53cb\u8c0a\u8def\u5e97,None,\u4e94\u5bb6\u6e20\u9ec4\u9875,\u9cb2\u9e4fWeb\uff08\u7f51\u7ad9\uff09\u6570\u636e\u6293\u53d6\uff08\u91c7\u96c6\uff09- \u6700\u4e13\u4e1aWeb\u6570\u636e\u91c7\u96c6\u670d\u52a1\u63d0\u4f9b\u8005\u3002\u9cb2\u9e4f\u9ec4\u9875\u6570\u636e\u7531\u9cb2\u9e4f\u6570\u636e\u91c7\u96c6\u4e8e\u4e92\u8054\u7f51\u3002"/>\r\n', u'\n<link rel="stylesheet" type="text/css" href="/static/css/base.css" />\n', '', u'\n</head>\n<body>\n\t<div id="wraper">\n\t <div class="header">\n\t <a href="/" title="\u9cb2\u9e4f\u9ec4\u9875 - \u7f51\u7f57\u5168\u4e2d\u56fd\u5546\u4e1a\u4fe1\u606f"><img src="/static/images/logo.jpg" alt="\u9cb2\u9e4f\u9ec4\u9875 - \u7f51\u7f57\u5168\u4e2d\u56fd\u5546\u4e1a\u4fe1\u606f"/></a>\n\t </div>\n\t <div class="main">\n\t '] |
context | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/template/debug.py
in render_node
def compile_function_error(self, token, e):
if not hasattr(e, 'source'):
e.source = token.source
class DebugNodeList(NodeList):
def render_node(self, node, context):
try:
result = node.render(context)...
except TemplateSyntaxError, e:
if not hasattr(e, 'source'):
e.source = node.source
raise
except Exception, e:
from sys import exc_info
Variable | Value |
---|---|
node | <Block Node: main. Contents: []> |
self | [<Text Node: '<!DOCTYPE html PUBLIC "-/'>, <Block Node: title. Contents: []>, <Text Node: ' - ???? - By ??Web???????'>, <Block Node: meta. Contents: []>, <Text Node: ' <link rel="stylesheet" t'>, <Block Node: jscss. Contents: []>, <Text Node: ' </head> <body> <div id='>, <Block Node: main. Contents: []>, <Text Node: ' </div> <div style='>] |
e | TemplateSyntaxError(u"Caught TypeError while rendering: object of type 'NoneType' has no len()",) |
context | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py
in render
push = block = block_context.pop(self.name)
if block is None:
block = self
# Create new block so we can store context without thread-safety issues.
block = BlockNode(block.name, block.nodelist)
block.context = context
context['block'] = block
result = block.nodelist.render(context)...
if push is not None:
block_context.push(self.name, push)
context.pop()
return result
def super(self):
Variable | Value |
---|---|
push | <Block Node: main. Contents: [<Text Node: ' <div class="guide"><a h'>, <Variable Node: business.city>, <Text Node: '/0/">'>, <Variable Node: business.city>, <Text Node: '??</a> > '>, <Variable Node: business.company_name>, <Text Node: '</div> <div id="restaura'>, <Variable Node: business.company_name>, <Text Node: '</h2> <ul> <li><b>??'>, <Variable Node: business.cate_name>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.province>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.city>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.area>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.contact_phone|default:business.telephone>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.address>, <Text Node: '</li> <!--<li><b>????<'>, <Variable Node: business.contact_people>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.website>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.email>, <Text Node: '</li>--> <li><b>???</b'>, <Variable Node: business.product>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.longitude>, <Text Node: '</li> <li><b>???</b><a'>, <Variable Node: business.latitude|truncate_chars:5>, <Text Node: '??????????????</a></li> '>, <Variable Node: business.description|linebreaks>, <Text Node: ' </div> '>]> |
block_context | <django.template.loader_tags.BlockContext object at 0x7f8e0cd84590> |
context | Error in formatting: 'Business' object has no attribute 'name' |
block | <Block Node: main. Contents: [<Text Node: ' <div class="guide"><a h'>, <Variable Node: business.city>, <Text Node: '/0/">'>, <Variable Node: business.city>, <Text Node: '??</a> > '>, <Variable Node: business.company_name>, <Text Node: '</div> <div id="restaura'>, <Variable Node: business.company_name>, <Text Node: '</h2> <ul> <li><b>??'>, <Variable Node: business.cate_name>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.province>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.city>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.area>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.contact_phone|default:business.telephone>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.address>, <Text Node: '</li> <!--<li><b>????<'>, <Variable Node: business.contact_people>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.website>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.email>, <Text Node: '</li>--> <li><b>???</b'>, <Variable Node: business.product>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.longitude>, <Text Node: '</li> <li><b>???</b><a'>, <Variable Node: business.latitude|truncate_chars:5>, <Text Node: '??????????????</a></li> '>, <Variable Node: business.description|linebreaks>, <Text Node: ' </div> '>]> |
self | <Block Node: main. Contents: []> |
/usr/local/lib/python2.7/dist-packages/django/template/base.py
in render
# extend_nodelist().
contains_nontext = False
def render(self, context):
bits = []
for node in self:
if isinstance(node, Node):
bits.append(self.render_node(node, context))...
else:
bits.append(node)
return mark_safe(''.join([force_unicode(b) for b in bits]))
def get_nodes_by_type(self, nodetype):
"Return a list of all nodes of the given type"
Variable | Value |
---|---|
node | <Variable Node: business.latitude|truncate_chars:5> |
self | [<Text Node: ' <div class="guide"><a h'>, <Variable Node: business.city>, <Text Node: '/0/">'>, <Variable Node: business.city>, <Text Node: '??</a> > '>, <Variable Node: business.company_name>, <Text Node: '</div> <div id="restaura'>, <Variable Node: business.company_name>, <Text Node: '</h2> <ul> <li><b>??'>, <Variable Node: business.cate_name>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.province>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.city>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.area>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.contact_phone|default:business.telephone>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.address>, <Text Node: '</li> <!--<li><b>????<'>, <Variable Node: business.contact_people>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.website>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.email>, <Text Node: '</li>--> <li><b>???</b'>, <Variable Node: business.product>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.longitude>, <Text Node: '</li> <li><b>???</b><a'>, <Variable Node: business.latitude|truncate_chars:5>, <Text Node: '??????????????</a></li> '>, <Variable Node: business.description|linebreaks>, <Text Node: ' </div> '>] |
bits | [u'\r\n<div class="guide"><a href="/">\u9996\u9875</a> > <a href="/city/', u'\u4e94\u5bb6\u6e20', u'/0/">', u'\u4e94\u5bb6\u6e20', u'\u9ec4\u9875</a> > ', u'\u5e74\u8f6e\u9152\u574a\u53cb\u8c0a\u8def\u5e97', u'</div>\r\n<div id="restaurant_details">\r\n <h2>', u'\u5e74\u8f6e\u9152\u574a\u53cb\u8c0a\u8def\u5e97', u'</h2>\r\n\t<ul>\r\n\t <li><b>\u5206\u7c7b\uff1a</b>', u'\u4e94\u5bb6\u6e20\u8d2d\u7269>>\u98df\u54c1\u8336\u9152>>\u5e74\u8f6e\u9152\u574a\u53cb\u8c0a\u8def\u5e97', u'</li>\r\n\t <li><b>\u7701\u4efd\uff1a</b>', u'\u65b0\u7586', u'</li>\r\n\t <li><b>\u57ce\u5e02\uff1a</b>', u'\u4e94\u5bb6\u6e20', u'</li>\r\n\t <li><b>\u57ce\u533a\uff1a</b>', u'\u4e94\u5bb6\u6e20\u53cb\u8c0a\u8def\u6b65\u884c\u8857', u'</li>\r\n\t <li><b>\u7535\u8bdd\uff1a</b>', u'', u'</li>\r\n\t <li><b>\u5730\u5740\uff1a</b>', u'\u4e94\u5bb6\u6e20\u53cb\u8c0a\u8def\u6b65\u884c\u8857', u'</li>\r\n\t <!--<li><b>\u8054\u7cfb\u4eba\uff1a</b>', u'None', u'</li>\r\n\t <li><b>\u7f51\u7ad9\uff1a</b>', u'None', u'</li>\r\n\t <li><b>\u90ae\u7bb1\uff1a</b>', u'None', u'</li>-->\r\n\t <li><b>\u4ea7\u54c1\uff1a</b>', u'', u'</li>\r\n\t <li><b>\u7ecf\u5ea6\uff1a</b>', u'None', u'</li>\r\n\t <li><b>\u7eac\u5ea6\uff1a</b><a href="http://www.site-digger.com" title="\u8054\u7cfb\u7f51\u7ad9\u5ba2\u670d\u67e5\u770b\u5b8c\u6574\u4fe1\u606f" target="_blank">'] |
context | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/template/debug.py
in render_node
def compile_function_error(self, token, e):
if not hasattr(e, 'source'):
e.source = token.source
class DebugNodeList(NodeList):
def render_node(self, node, context):
try:
result = node.render(context)...
except TemplateSyntaxError, e:
if not hasattr(e, 'source'):
e.source = node.source
raise
except Exception, e:
from sys import exc_info
Variable | Value |
---|---|
node | <Variable Node: business.latitude|truncate_chars:5> |
e | TypeError("object of type 'NoneType' has no len()",) |
self | [<Text Node: ' <div class="guide"><a h'>, <Variable Node: business.city>, <Text Node: '/0/">'>, <Variable Node: business.city>, <Text Node: '??</a> > '>, <Variable Node: business.company_name>, <Text Node: '</div> <div id="restaura'>, <Variable Node: business.company_name>, <Text Node: '</h2> <ul> <li><b>??'>, <Variable Node: business.cate_name>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.province>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.city>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.area>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.contact_phone|default:business.telephone>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.address>, <Text Node: '</li> <!--<li><b>????<'>, <Variable Node: business.contact_people>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.website>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.email>, <Text Node: '</li>--> <li><b>???</b'>, <Variable Node: business.product>, <Text Node: '</li> <li><b>???</b>'>, <Variable Node: business.longitude>, <Text Node: '</li> <li><b>???</b><a'>, <Variable Node: business.latitude|truncate_chars:5>, <Text Node: '??????????????</a></li> '>, <Variable Node: business.description|linebreaks>, <Text Node: ' </div> '>] |
context | Error in formatting: 'Business' object has no attribute 'name' |
wrapped | TemplateSyntaxError(u"Caught TypeError while rendering: object of type 'NoneType' has no len()",) |
exc_info | <built-in function exc_info> |
/usr/local/lib/python2.7/dist-packages/django/template/debug.py
in render
wrapped.exc_info = exc_info()
raise wrapped, None, wrapped.exc_info[2]
return result
class DebugVariableNode(VariableNode):
def render(self, context):
try:
output = self.filter_expression.resolve(context)...
output = localize(output, use_l10n=context.use_l10n)
output = force_unicode(output)
except TemplateSyntaxError, e:
if not hasattr(e, 'source'):
e.source = self.source
raise
Variable | Value |
---|---|
self | <Variable Node: business.latitude|truncate_chars:5> |
context | Error in formatting: 'Business' object has no attribute 'name' |
/usr/local/lib/python2.7/dist-packages/django/template/base.py
in resolve
if not lookup:
arg_vals.append(mark_safe(arg))
else:
arg_vals.append(arg.resolve(context))
if getattr(func, 'needs_autoescape', False):
new_obj = func(obj, autoescape=context.autoescape, *arg_vals)
else:
new_obj = func(obj, *arg_vals)...
if getattr(func, 'is_safe', False) and isinstance(obj, SafeData):
obj = mark_safe(new_obj)
elif isinstance(obj, EscapeData):
obj = mark_for_escaping(new_obj)
else:
obj = new_obj
Variable | Value |
---|---|
ignore_failures | False |
obj | None |
context | Error in formatting: 'Business' object has no attribute 'name' |
self | <django.template.base.FilterExpression object at 0x7f8e0ce4ac10> |
args | [(True, <Variable: u'5'>)] |
arg_vals | [5] |
lookup | True |
func | <function truncate_chars at 0x7f8e0ea1a758> |
arg | <Variable: u'5'> |
/var/www/clients/client1/web7/web/yellowpage/filter/templatetags/custom.py
in truncate_chars
s = str(s)
if isinstance(s, unicode):
s = s.encode('utf-8')
return binascii.b2a_hex(DES.encrypt(DES.IV, DES.KEY, s))
@register.filter("truncate_chars")
def truncate_chars(value, max_length):
if len(value) > max_length:...
truncd_val = value[:max_length]
if not len(value) == max_length+1 and value[max_length+1] != " ":
truncd_val = truncd_val[:truncd_val.rfind(" ")]
return truncd_val + "..."
return value
Variable | Value |
---|---|
max_length | 5 |
value | None |
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
mod_wsgi.listener_port | '80' |
CONTEXT_DOCUMENT_ROOT | '/var/www/business.site-digger.com/web' |
SERVER_SOFTWARE | 'Apache/2.4.7 (Ubuntu)' |
SCRIPT_NAME | u'' |
mod_wsgi.enable_sendfile | '0' |
mod_wsgi.handler_script | '' |
SERVER_SIGNATURE | '<address>Apache/2.4.7 (Ubuntu) Server at business.site-digger.com Port 80</address>\n' |
REQUEST_METHOD | 'GET' |
PATH_INFO | u'/business/32555a38307058796864773d/' |
SERVER_PROTOCOL | 'HTTP/1.1' |
QUERY_STRING | '' |
HTTP_USER_AGENT | 'claudebot' |
SERVER_NAME | 'business.site-digger.com' |
REMOTE_ADDR | '54.224.52.210' |
mod_wsgi.queue_start | '1711778308920230' |
mod_wsgi.request_handler | 'wsgi-script' |
wsgi.url_scheme | 'http' |
PATH_TRANSLATED | '/var/www/clients/client1/web7/web/django.wsgi/business/32555a38307058796864773d/' |
SERVER_PORT | '80' |
wsgi.multiprocess | True |
mod_wsgi.input_chunked | '0' |
SERVER_ADDR | '47.90.32.133' |
DOCUMENT_ROOT | '/var/www/business.site-digger.com/web' |
mod_wsgi.process_group | '' |
SCRIPT_FILENAME | '/var/www/clients/client1/web7/web/django.wsgi' |
SERVER_ADMIN | 'webmaster@business.site-digger.com' |
wsgi.input | <mod_wsgi.Input object at 0x7f8e0ceaab70> |
HTTP_HOST | 'business.site-digger.com' |
CONTEXT_PREFIX | '' |
wsgi.multithread | False |
mod_wsgi.callable_object | 'application' |
REQUEST_URI | '/business/32555a38307058796864773d/' |
HTTP_ACCEPT | '*/*' |
wsgi.version | (1, 0) |
GATEWAY_INTERFACE | 'CGI/1.1' |
wsgi.run_once | False |
wsgi.errors | <mod_wsgi.Log object at 0x7f8e0ceaa770> |
REMOTE_PORT | '46058' |
mod_wsgi.listener_host | '' |
REQUEST_SCHEME | 'http' |
mod_wsgi.version | (3, 4) |
mod_wsgi.application_group | 'business.site-digger.com|' |
mod_wsgi.script_reloading | '1' |
wsgi.file_wrapper | '' |
CSRF_COOKIE | 'c810ce97b3af87dc0a3e069711fba532' |
yellowpage.settings
Setting | Value |
---|---|
USE_L10N | True |
USE_THOUSAND_SEPARATOR | False |
LANGUAGE_CODE | 'en-us' |
ROOT_URLCONF | 'yellowpage.urls' |
MANAGERS | (('Qi', 'redice@163.com'),) |
DEFAULT_CHARSET | 'utf-8' |
STATIC_ROOT | '' |
TEST_DATABASE_CHARSET | None |
MESSAGE_STORAGE | 'django.contrib.messages.storage.user_messages.LegacyFallbackStorage' |
DATABASE_HOST | '' |
IGNORABLE_404_STARTS | ('/cgi-bin/', '/_vti_bin', '/_vti_inf') |
SEND_BROKEN_LINK_EMAILS | False |
URL_VALIDATOR_USER_AGENT | 'Django/1.3.1 (http://www.djangoproject.com)' |
STATICFILES_FINDERS | ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder') |
SESSION_COOKIE_DOMAIN | None |
SESSION_COOKIE_NAME | 'sessionid' |
COMMENTS_MODERATORS_GROUP | None |
TIME_INPUT_FORMATS | ('%H:%M:%S', '%H:%M') |
DATABASES | {'default': {'ENGINE': 'django.db.backends.mysql', 'HOST': '', 'NAME': 'c1business', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': '', 'TEST_CHARSET': None, 'TEST_COLLATION': None, 'TEST_MIRROR': None, 'TEST_NAME': None, 'TIME_ZONE': 'America/Chicago', 'USER': 'c1business'}} |
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 |
LOCALE_PATHS | () |
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 | '/' |
ABS_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') |
FIRST_DAY_OF_WEEK | 0 |
TEMPLATE_DEBUG | True |
AUTHENTICATION_BACKENDS | ('django.contrib.auth.backends.ModelBackend',) |
TEST_DATABASE_COLLATION | None |
FORCE_SCRIPT_NAME | None |
CACHE_BACKEND | 'locmem://' |
USE_X_FORWARDED_HOST | False |
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.contenttypes', 'django.contrib.messages', 'yellowpage.company', 'yellowpage.filter'] |
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 | False |
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 | '/static/admin/' |
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 | '' |
PROJECT_PATH | '/var/www/clients/client1/web7/web/yellowpage' |
TEMPLATE_STRING_IF_INVALID | '' |
COMMENTS_ALLOW_PROFANITIES | False |
LOGOUT_URL | '/accounts/logout/' |
EMAIL_USE_TLS | False |
TEMPLATE_DIRS | ('/var/www/clients/client1/web7/web/yellowpage/templates',) |
FIXTURE_DIRS | () |
EMAIL_HOST | 'localhost' |
DATE_FORMAT | 'N j, Y' |
MEDIA_ROOT | '' |
ADMINS | (('Qi', 'redice@163.com'),) |
FORMAT_MODULE_PATH | None |
DEFAULT_FROM_EMAIL | 'webmaster@localhost' |
STATICFILES_DIRS | () |
MEDIA_URL | '' |
DATETIME_FORMAT | 'N j, Y, P' |
EMAIL_SUBJECT_PREFIX | '[Django] ' |
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 | 'America/Chicago' |
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') |
SESSION_COOKIE_AGE | 1209600 |
SETTINGS_MODULE | 'yellowpage.settings' |
USE_ETAGS | False |
LANGUAGES_BIDI | ('he', 'ar', 'fa') |
DEFAULT_INDEX_TABLESPACE | '' |
INTERNAL_IPS | () |
STATIC_URL | None |
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 | '********************' |
ADMIN_FOR | () |
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.