0

我已经浏览了我的模板,确保没有任何可以找到此代码的痕迹,现在最终向 stackoverflow 社区寻求帮助

Traceback (most recent call last):

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 150, in get_response
   response = callback(request, **param_dict)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/decorators.py", line 93, in _wrapped_view
   response = view_func(request, *args, **kwargs)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/views/defaults.py", line 19, in page_not_found
   return http.HttpResponseNotFound(t.render(RequestContext(request, {'request_path': request.path})))

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 123, in render
   return self._render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
   return self.nodelist.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 744, in render
   bits.append(self.render_node(node, context))

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
   return node.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
   return compiled_parent._render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
   return self.nodelist.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 744, in render
   bits.append(self.render_node(node, context))

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
   return node.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/defaulttags.py", line 311, in render
   return self.nodelist_true.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 744, in render
   bits.append(self.render_node(node, context))

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
   return node.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/defaulttags.py", line 313, in render
   return self.nodelist_false.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 744, in render
   bits.append(self.render_node(node, context))

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
   return node.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/defaulttags.py", line 313, in render
   return self.nodelist_false.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 744, in render
   bits.append(self.render_node(node, context))

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
   return node.render(context)

 File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/defaulttags.py", line 450, in render
   raise e

NoReverseMatch: Reverse for 'dashboard_follow_user' with arguments '('',)' and keyword arguments '{}' not found.


<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'__cfduid': 'd8e6bd680abeae8bf20e0b04bab2bf6c01340266740',
'__utma': '252251985.852406610.1340266743.1341240383.1341474269.15',
'__utmb': '252251985.1.10.1341474269',
'__utmc': '252251985',
'__utmz': '252251985.1340266743.1.1.utmcsr=facebook.com|utmccn=(referral)|utmcmd=referral|utmcct=/l.php',
'csrftoken': 'acdd7043eb39d9c14a3954786986512b',
'sessionid': '53868fdef6c96037ee26cf62fca1de9b'},
META:{'CONTENT_LENGTH': '',
'CONTENT_TYPE': '',
'CSRF_COOKIE': 'acdd7043eb39d9c14a3954786986512b',
'HTTP_ACCEPT': '*/*',
'HTTP_ACCEPT_ENCODING': 'gzip',
'HTTP_CF_CONNECTING_IP': '62.95.0.45',
'HTTP_CF_IPCOUNTRY': 'SE',
'HTTP_CF_VISITOR': '{"scheme":"http"}',
'HTTP_CONNECTION': 'close',
'HTTP_COOKIE': 'csrftoken=acdd7043eb39d9c14a3954786986512b; __cfduid=d8e6bd680abeae8bf20e0b04bab2bf6c01340266740; __utma=252251985.852406610.1340266743.1341240383.1341474269.15; __utmz=252251985.1340266743.1.1.utmcsr=facebook.com|utmccn=(referral)|utmcmd=referral|utmcct=/l.php; sessionid=53868fdef6c96037ee26cf62fca1de9b; __utmb=252251985.1.10.1341474269; __utmc=252251985',
'HTTP_HOST': 'myapp.com',
'HTTP_USER_AGENT': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
'HTTP_X_FORWARDED_FOR': '62.95.0.45, 173.245.49.189',
'HTTP_X_FORWARDED_PROTO': 'http',
'HTTP_X_HEROKU_DYNOS_IN_USE': '1',
'HTTP_X_HEROKU_QUEUE_DEPTH': '0',
'HTTP_X_HEROKU_QUEUE_WAIT_TIME': '1',
'HTTP_X_REAL_IP': '173.245.49.189',
'HTTP_X_REQUEST_START': '1341474274655',
'HTTP_X_VARNISH': '958793214',
'PATH_INFO': u'/favicon.ico/',
'QUERY_STRING': '',
'RAW_URI': '/favicon.ico/',
'REMOTE_ADDR': '173.245.49.189',
'REMOTE_PORT': '80',
'REQUEST_METHOD': 'GET',
'SCRIPT_NAME': u'',
'SERVER_NAME': 'myapp.com',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SOFTWARE': 'gunicorn/0.12.2',
'gunicorn.socket': <socket._socketobject object at 0x3e24520>,
'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fb5a0518270>,
'wsgi.file_wrapper': <class gunicorn.http.wsgi.FileWrapper at 0x3422188>,
'wsgi.input': <gunicorn.http.body.Body object at 0x3c02610>,
'wsgi.multiprocess': True,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>
4

1 回答 1

0

You probably have in your template:

{% url dashboard_follow_user something %}

where something is an empty string "", while your urls.py probably says something like:

(r"/something/(?P<id>\d+)$"), "myview", {}, "dashboard_follow_user")

And it simply expects an int or something else, but not empty string("").

The reason for this stack trace is that this is the usual stack when rendering template elements, which are rendered one by one.

于 2012-07-05T08:18:02.323 回答