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

TypeError: object HttpResponse can't be used in 'await' expression #502

Closed
QuvonchbekBobojonov opened this issue Mar 15, 2024 · 3 comments
Closed

Comments

@QuvonchbekBobojonov
Copy link

TypeError: object HttpResponse can't be used in 'await' expression
2024-03-15 11:29:33 ERROR Internal Server Error: /
Traceback (most recent call last):
  File "/Users/darklaki/PycharmProjects/naktutka_web/.venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/darklaki/PycharmProjects/naktutka_web/.venv/lib/python3.12/site-packages/whitenoise/middleware.py", line 124, in __call__
    return self.get_response(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/darklaki/PycharmProjects/naktutka_web/.venv/lib/python3.12/site-packages/asgiref/sync.py", line 277, in __call__
    return call_result.result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/darklaki/PycharmProjects/naktutka_web/.venv/lib/python3.12/site-packages/asgiref/sync.py", line 353, in main_wrap
    result = await self.awaitable(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object HttpResponse can't be used in 'await' expression
2024-03-15 11:29:33 DEBUG HTTP 500 response started for ['127.0.0.1', 49896]
2024-03-15 11:29:33 DEBUG HTTP response chunk for ['127.0.0.1', 49896]
2024-03-15 11:29:33 DEBUG HTTP close for ['127.0.0.1', 49896]
2024-03-15 11:29:33 DEBUG HTTP response complete for ['127.0.0.1', 49896]
HTTP GET / 500 [0.04, 127.0.0.1:49896]
2024-03-15 11:29:33 ERROR HTTP GET / 500 [0.04, 127.0.0.1:49896]
@carltongibson
Copy link
Member

Update your white noise middleware.

@QuvonchbekBobojonov
Copy link
Author

Update your white noise middleware.

how can i update

@carltongibson
Copy link
Member

Don't know.

Looks like Whitenoise might not yet be compatible with ASGI. See evansd/whitenoise#359 and related issues.

You'll need to investigate.

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

2 participants