-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Labels
api: loggingIssues related to the googleapis/python-logging API.Issues related to the googleapis/python-logging API.
Description
I tryed to use google.cloud.logging_v2.handlers.middleware.RequestMiddleware at Django 4.1.3, Python 3.10 but errors raises bellow:
Environment details
- OS type and version: Linux
- Python version:
3.10 - pip version:
pip-22.3.1 google-cloud-loggingversion:3.2.5
Steps to reproduce
- Create new Django project.
- Add the
RequestMiddlewareto settings.MIDDLEWARE - start runserver
- access
/path --> error raised.
Code example
# settings.py at Django
MIDDLEWARE = [
'google.cloud.logging_v2.handlers.middleware.RequestMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]Stack trace
Traceback (most recent call last):
File "/home/vagrant/tmp/myproject/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/home/vagrant/tmp/myproject/venv/lib/python3.10/site-packages/django/utils/deprecation.py", line 131, in __call__
if self._is_coroutine:
AttributeError: 'RequestMiddleware' object has no attribute '_is_coroutine'
At the same code, when using Django 4.0.8, it's working.
Metadata
Metadata
Assignees
Labels
api: loggingIssues related to the googleapis/python-logging API.Issues related to the googleapis/python-logging API.