登陆后直接报500是什么原因?
fangzaixiang opened this issue · comments
您好,我因为也是刚刚 接触 Python,运行您的代码后登陆直接报错了
[04/Nov/2016 17:44:04]"POST /admin/login/?next=/wechat/ HTTP/1.1" 302 0
ERROR 2016-11-04 17:44:04,030 base 12058 140062940415744 Internal Server Error: /wechat/
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/wechat-spider/wechatspider/util.py", line 48, in _wrapper
return f(request, *args, **kwargs)
File "/wechat-spider/wechat/views.py", line 62, in index
"downloader": r.llen(CRAWLER_CONFIG['downloader']) or 0,
File "/usr/local/lib/python2.7/site-packages/redis/client.py", line 1202, in llen
return self.execute_command('LLEN', name)
File "/usr/local/lib/python2.7/site-packages/redis/client.py", line 570, in execute_command
connection.send_command(*args)
File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 556, in send_command
self.send_packed_command(self.pack_command(*args))
File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 532, in send_packed_command
self.connect()
File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 436, in connect
raise ConnectionError(self._error_message(e))
ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
ERROR 2016-11-04 17:44:04,030 base 12058 140062940415744 Internal Server Error: /wechat/
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/wechat-spider/wechatspider/util.py", line 48, in _wrapper
return f(request, *args, **kwargs)
File "/wechat-spider/wechat/views.py", line 62, in index
"downloader": r.llen(CRAWLER_CONFIG['downloader']) or 0,
File "/usr/local/lib/python2.7/site-packages/redis/client.py", line 1202, in llen
return self.execute_command('LLEN', name)
File "/usr/local/lib/python2.7/site-packages/redis/client.py", line 570, in execute_command
connection.send_command(*args)
File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 556, in send_command
self.send_packed_command(self.pack_command(*args))
File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 532, in send_packed_command
self.connect()
File "/usr/local/lib/python2.7/site-packages/redis/connection.py", line 436, in connect
raise ConnectionError(self._error_message(e))
ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
[04/Nov/2016 17:44:04]"GET /wechat/ HTTP/1.1" 500 27
页面显示是500 的错误,请问我大体是哪个地方出了问题
Error 111 connecting to localhost:6379. Connection refused.
没开 Redis.
README 里都有的。
好的,谢谢了已经可以运行了