Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache_response get error: inner() missing 1 required positional argument: 'request' #336

Open
Undertone0809 opened this issue May 9, 2023 · 0 comments

Comments

@Undertone0809
Copy link

My code as follows:

@cache_response(60 * 30)
@api_view(['GET'])
def get_surface_subsidence_data(request, measuring_point_id: int, node_id: int):
    pass

It's normal if I didn't use @cache_response. I got a error TypeError: inner() missing 1 required positional argument: 'request' after I using @cache_response. I wonder why?

  • detail error info
2023-05-09 21:08:12,827 - ERROR - "GET /device/surface_subsidence/19734/1/ HTTP/1.1" 500 70917
2023-05-09 21:08:13,107 - ERROR - Internal Server Error: /device/surface_subsidence/19734/1/
Traceback (most recent call last):
  File "E:\Programming\anaconda\envs\wisdom_engineering\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "E:\Programming\anaconda\envs\wisdom_engineering\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
TypeError: inner() missing 1 required positional argument: 'request'
2023-05-09 21:08:13,109 - ERROR - "GET /device/surface_subsidence/19734/1/ HTTP/1.1" 500 70917
2023-05-09 21:08:13,372 - ERROR - Internal Server Error: /device/surface_subsidence/19734/1/
Traceback (most recent call last):
  File "E:\Programming\anaconda\envs\wisdom_engineering\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "E:\Programming\anaconda\envs\wisdom_engineering\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
TypeError: inner() missing 1 required positional argument: 'request'
2023-05-09 21:08:13,374 - ERROR - "GET /device/surface_subsidence/19734/1/ HTTP/1.1" 500 70917
2023-05-09 21:08:13,963 - ERROR - Internal Server Error: /device/surface_subsidence/19734/1/
Traceback (most recent call last):
  File "E:\Programming\anaconda\envs\wisdom_engineering\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "E:\Programming\anaconda\envs\wisdom_engineering\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
TypeError: inner() missing 1 required positional argument: 'request'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant