2014-01-16 3 views
0

나는이 내가 시도 할 때 AttributeError("'WSGIRequest' object has no attribute 'args'",) 이 호출장고 WSGIRequest의 인수 오류

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') 
+0

우리는 추적없이 무슨 일이 일어나는지 알아 내야합니까? –

+0

사과. 추가 된 –

+0

이것은 흔적이 아니며 다른 임의의 코드로 보입니다. –

답변

1

HttpRequest 객체가 args 속성이없는

다음은 역 추적입니다.

당신은

request.GET.get('s3_object_name') 

s3_object_name value를 얻기 위해 사용해야합니다.

장고 설명서는 HttpRequest에 우수 section입니다.

+0

그래, 그게 다야! 먼저 ... 설명서를 기억해야합니다! –