请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

django连接失败

直接运行了老师django代码,显示运行错误,以下是报错信息

Internal Server Error: /
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\redis-3.5.3-py3.7.egg\redis\connection.py", line 555, in connect
    sock = self._connect()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\redis-3.5.3-py3.7.egg\redis\connection.py", line 611, in _connect
    raise err
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\redis-3.5.3-py3.7.egg\redis\connection.py", line 599, in _connect
    sock.connect(socket_address)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\views\generic\base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\django\views\generic\base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "F:\Graduation_Project\coding-92\LcvSearch\search\views.py", line 17, in get
    topn_search = redis_cli.zrevrangebyscore("search_keywords_set", "+inf", "-inf", start=0, num=5)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\redis-3.5.3-py3.7.egg\redis\client.py", line 3049, in zrevrangebyscore
    return self.execute_command(*pieces, **options)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\redis-3.5.3-py3.7.egg\redis\client.py", line 936, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\redis-3.5.3-py3.7.egg\redis\connection.py", line 1146, in get_connection
    connection.connect()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\redis-3.5.3-py3.7.egg\redis\connection.py", line 559, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 10061 connecting to localhost:6379. 由于目标计算机积极拒绝,无法连接。.
[11/Apr/2021 20:58:18] "GET / HTTP/1.1" 500 108235
Not Found: /favicon.ico
[11/Apr/2021 20:58:19] "GET /favicon.ico HTTP/1.1" 404 2365

正在回答

1回答

bobby 2021-04-13 09:53:16

连接redis失败 你要启动一下redis的server


0 回复 有任何疑惑可以回复我~
  • 提问者 慕仔0180192 #1
    非常感谢!
    回复 有任何疑惑可以回复我~ 2021-04-21 17:17:46
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信