搜索提交信息时出现问题
来源:15-9 搜索记录、热门搜索功能实现 - 2
躺着学代码
2018-11-28
TypeError at /search/
zincrby() missing 1 required positional argument: 'value’
Request Method: GET
Request URL: http://127.0.0.1:8000/search/?q=java&s_type=article
Django Version: 2.1.3
Exception Type: TypeError
Exception Value:
zincrby() missing 1 required positional argument: 'value’
Exception Location: C:\Users\Administrator\PycharmProjects\LcvSearch\search\views.py in get, line 68
Python Executable: C:\Users\Administrator\AppData\Local\Programs\Python\Python35\python.exe
Python Version: 3.5.2
Python Path:
[‘C:\Users\Administrator\PycharmProjects\LcvSearch’,
‘C:\Users\Administrator\PycharmProjects\LcvSearch’,
‘C:\Users\Administrator\AppData\Local\Programs\Python\Python35\python35.zip’,
‘C:\Users\Administrator\AppData\Local\Programs\Python\Python35\DLLs’,
‘C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib’,
‘C:\Users\Administrator\AppData\Local\Programs\Python\Python35’,
‘C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages’,
'C:\Program Files\JetBrains\PyCharm '
‘2018.2.5\helpers\pycharm_matplotlib_backend’]
Server time: Wed, 28 Nov 2018 02:26:19 +0000
2回答
-
非凡哥大战哥斯拉
2018-11-29
提示说了“Exception Location: C:\Users\Administrator\PycharmProjects\LcvSearch\search\views.py in get, line 68”
在第68行出问题。
zincrby() missing 1 required positional argument: 'value'说的是zincrby()方法传少了一个必要的参数,看看有没有变量写少了呗
另外,可能因为版本问题,bobby老师里面的zincrby()方法没有传入amount值的,我自己后来添加之后就行了redis_cli.zincrby(name="search_keyword_set",value=key_words,amount=1)
112019-04-15 -
bobby
2018-11-29
新版本的redis的这个接口需要多设置一个值 value, 注释里面有value是什么意思
00
相似问题
回答 1
回答 1