'QueryDict' object is not callable 错误解析

我把request内置库和 requests库  给搞混了

requests使用来发送请求的,

request 而是用来获取数据的

别看只有一个单词只差,却让我找了大半天

requests.post(***) 发送请求  post必须是小写的

request.POST.get() 是用来获取数据的

这是错误的代码

    re_dict = request.POSt(access_token_url,data={
        "client_id": ‘3792702162‘,
        "client_secret": "6c070dfa032e5d2c363f5a3d9789220d",
        "grant_type":"authorization_code",
        "code": code,
        "redirect_uri": "http://127.0.0.1:8000/md_admin/weibo",
    })

这是正确的

    re_dict = requests.post(access_token_url,data={
        "client_id": ‘3792702162‘,
        "client_secret": "6c070dfa032e5d2c363f5a3d9789220d",
        "grant_type":"authorization_code",
        "code": code,
        "redirect_uri": "http://127.0.0.1:8000/md_admin/weibo",
    })

'QueryDict' object is not callable 错误解析

原文地址:https://www.cnblogs.com/weifeng-888/p/10749659.html

时间: 2024-08-05 19:06:55

'QueryDict' object is not callable 错误解析的相关文章

TypeError: 'QueryDict' object is not callable

id = int(request.POST('id')) Error message: TypeError: 'QueryDict' object is not callable Error reseaon: request.POST is a QueryDict, dictionary lookup syntax instead: id = int(request.POST['id']) TypeError: 'QueryDict' object is not callable

python"TypeError: 'NoneType' object is not iterable"错误解析

尊重原创博主,原文链接:https://blog.csdn.net/dataspark/article/details/9953225 [解析] 一般是函数返回值为None,并被赋给了多个变量. 实例看下: c=0def test(): if c == 1: a = b = 1 return a, b a, b = test() 使用 a, b = test()调用时,就会报错:TypeError: 'NoneType' object is not iterable 在Python判断语句中,当

[python]一个低级错误/xxx instance has no attribute 'xxx'/'module' object is not callable

今天在写代码的时候出现了以下两个错误: TypeError: 'module' object is not callable AttributeError: excelChange instance has no attribute 'xlBook' 上网一查,发现第一个错误是由于python中有两种不同的引用方式 import xxx 和 from xxx import *,前者在代码中引用时需要加上模块名和具体的方法或属性,具体方法如下: import catchForm self.xls

python3错误之TypeError: 'dict_items' object is not callable

这种错误出现在循环结构中套循环结构,而循环时内部循环为字典,外部循环为该字典调用items方法后取到的值,内部循环调用外部循环中遍历的结果: 解决方案: 将外部循环的items()方法调用改为.keys() or .values()然后在内部循环中调用即可 python3错误之TypeError: 'dict_items' object is not callable

记一个小错误:'numpy.ndarray' object is not callable

错误在于mfcc是已经定义的函数,所以变量名改为wav_mfcc,问题就解决了. 参考博客: https://blog.csdn.net/Olaking/article/details/43199003 记一个小错误:'numpy.ndarray' object is not callable 原文地址:https://www.cnblogs.com/yuren1998/p/11558700.html

TypeError:'dict' object is not callable

TypeError:'dict' object is not callable 出现这种错误有两种可能: 1. 代码里重新定义了dict,比如 dict= {...},这时调用的是代码里定义的dict而不是python内置类型 2. 取字典内容时用了()而不是[].比如sdict("content_id"),应该是sdict["content_id"] TypeError:'dict' object is not callable

GCC 常见错误解析

1GCC 常见错误解析一.错误类型第一类∶C 语法错误错误信息∶文件source.c 中第n 行有语法错误(syntex errror).这种类型的错误,一般都是 C 语言的语法错误,应该仔细检查源代码文件中第n 行及该行之前的程序,有时也需要对该文件所包含的头文件进行检查.有些情况下,一个很简单的语法错误,gcc 会给出一大堆错误,此时要保持清醒的头脑,不要被其吓倒,必要的时候再参考一下C 语言的基本教材.第二类∶头文件错误错误信息∶找不到头文件head.h(Can not find incl

python报错'str' object is not callable

>>> x=1.235 >>> int(x) 1 >>> str="fsgavfdbafdbntsbgbt" >>> len(str) 19 >>> >>> x=987456123 >>> str(x) 会报错'str' object is not callable. str()是系统自带的,你不能在用它的时候自己同时定义一个别的叫做str的变量,这样会冲突.

Python: TypeError: 'dict' object is not callable

问题:  TypeError: 'dict' object is not callable 原因:  dict()是python的一个内建函数,如果将dict自定义为一个python字典,在之后想调用dict()函数是会报出"TypeError: 'dict' object is not callable"的错误, 解决办法:  >>>del (dict) Python: TypeError: 'dict' object is not callable 原文地址:ht