直接运行了老师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
带你彻底掌握Scrapy,用Django+Elasticsearch搭建搜索引擎
了解课程