Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

RequestMiddleware not working at Django 4.1 #677

Copy link
Copy link
Closed
@tokibito

Description

@tokibito
Issue body actions

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-logging version: 3.2.5

Steps to reproduce

  1. Create new Django project.
  2. Add the RequestMiddleware to settings.MIDDLEWARE
  3. start runserver
  4. 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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.