Django WSGIRequest args错误

blue_zinc

AttributeError("'WSGIRequest' object has no attribute 'args'",)当我尝试拨打此电话时,我得到了

GET /sign_s3/?s3_object_type=image/jpeg&s3_object_name=default_name

我想念什么吗?

*args, **kwargs除了要求外,我还需要包括其他内容吗?

这是回溯:

            response = middleware_method(request, callback, callback_args, callback_kwargs)
            if response:
                break
    if response is None:
        wrapped_callback = self.make_view_atomic(callback)
        try:
            response = wrapped_callback(request, *callback_args, **callback_kwargs) ...
        except Exception as e:
            # If the view raised an exception, run it through exception
            # middleware, and if the exception middleware returns a
            # response, use that. Otherwise, reraise the exception.
            for middleware_method in self._exception_middleware:
                response = middleware_method(request, e)

风景:

@login_required()
def sign_s3(request):
    object_name = request.args.get('s3_object_name') 
奈杰尔·图弗尔(Nigel Tufnel)

HttpRequest对象没有args属性。

你应该用

request.GET.get('s3_object_name')

得到s3_object_name value

Django文档具有优良的部分HttpRequest

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Django 错误“WSGIRequest”对象没有属性“玩家”

django分页错误:AttributeError:'WSGIRequest'对象没有属性'Get'

Django测试用例错误“ WSGIRequest”对象没有属性“ session”

Django无法在内部服务器错误时解析WSGIRequest的POST参数

Django - 'WSGIRequest' 对象没有属性 'get'

Django'WSGIRequest'对象没有属性'data'

Django'WSGIRequest'对象没有属性'Post'

编写Django代码时,我一直收到此错误:“ WSGIRequest”对象没有属性“ profile”

'WSGIRequest'对象没有属性'user'Django admin

Django 2.0的问题:“ WSGIRequest”对象没有属性“ session”

Django'WSGIRequest'对象在/ admin /处的AttributeError没有属性'user'

'WSGIRequest'对象没有属性'sessions'(Django 2.1.2)

Django:AttributeError 'WSGIRequest' 对象没有属性 'get'

属性错误:'WSGIRequest' 对象没有属性 'get'

从Django 1.3升级到1.9时,'WSGIRequest'对象没有属性'session'

将JavaScript变量Ajaxing到Django视图,获取:AttributeError:'WSGIRequest'对象没有属性'data'

Django:“ WSGIRequest”对象没有属性“ user”?-AuthenticationMiddleware和SessionAuthenticationMiddleware按顺序

我一直在Django上获取'WSGIRequest'对象没有属性'Get'

将数据从JSON导入到Django AttributeError:“ WSGIRequest”对象没有属性“ data”

Python 3中的Django问题“ super()参数1必须是类型,而不是WSGIRequest”

Django单元测试:AttributeError:'WSGIRequest'对象没有属性'user'

从请求对象获取数据时,“ WSGIRequest”对象没有属性“ objects”错误

为什么我收到此错误“ WSGIRequest”对象没有属性“ kwargs”?

尝试根据登录用户的用户名创建模型对象时出现“WSGIRequest”错误

类型错误:不支持 + 的操作数类型:'WSGIRequest' 和 'str'

** args和* kwargs错误

Kubectl传递args错误

错误getPlayer(args [0]);

'WSGIRequest' 对象没有属性 'is_authenticated'