Title: RequestMiddleware not working at Django 4.1 · Issue #677 · googleapis/python-logging · GitHub
Open Graph Title: RequestMiddleware not working at Django 4.1 · Issue #677 · googleapis/python-logging
X Title: RequestMiddleware not working at Django 4.1 · Issue #677 · googleapis/python-logging
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-...
Open Graph 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....
X 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....
Opengraph URL: https://github.com/googleapis/python-logging/issues/677
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RequestMiddleware not working at Django 4.1","articleBody":"I tryed to use `google.cloud.logging_v2.handlers.middleware.RequestMiddleware` at Django 4.1.3, Python 3.10 but errors raises bellow:\r\n\r\n#### Environment details\r\n\r\n - OS type and version: Linux\r\n - Python version: `3.10`\r\n - pip version: `pip-22.3.1`\r\n - `google-cloud-logging` version: `3.2.5`\r\n\r\n#### Steps to reproduce\r\n\r\n 1. Create new Django project.\r\n 2. Add the `RequestMiddleware` to settings.MIDDLEWARE\r\n 3. start runserver\r\n 4. access `/` path --\u003e error raised.\r\n\r\n#### Code example\r\n\r\n```python\r\n# settings.py at Django\r\nMIDDLEWARE = [\r\n 'google.cloud.logging_v2.handlers.middleware.RequestMiddleware',\r\n 'django.middleware.security.SecurityMiddleware',\r\n 'django.contrib.sessions.middleware.SessionMiddleware',\r\n 'django.middleware.common.CommonMiddleware',\r\n 'django.middleware.csrf.CsrfViewMiddleware',\r\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n 'django.contrib.messages.middleware.MessageMiddleware',\r\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\r\n]\r\n```\r\n\r\n#### Stack trace\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/vagrant/tmp/myproject/venv/lib/python3.10/site-packages/django/core/handlers/exception.py\", line 55, in inner\r\n response = get_response(request)\r\n File \"/home/vagrant/tmp/myproject/venv/lib/python3.10/site-packages/django/utils/deprecation.py\", line 131, in __call__\r\n if self._is_coroutine:\r\nAttributeError: 'RequestMiddleware' object has no attribute '_is_coroutine'\r\n```\r\n\r\nAt the same code, when using Django 4.0.8, it's working.","author":{"url":"https://github.com/tokibito","@type":"Person","name":"tokibito"},"datePublished":"2022-11-29T05:32:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/677/python-logging/issues/677"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b385ecae-9e3c-eaf3-58ce-a6260e21b4bd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB18:A6D52:6A08051:948714B:6A5053FC |
| html-safe-nonce | 7571de9bab146a7deca3ecb414cd3119a35d3b2a687a299e5acfef268c098c14 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjE4OkE2RDUyOjZBMDgwNTE6OTQ4NzE0Qjo2QTUwNTNGQyIsInZpc2l0b3JfaWQiOiIyMTMwMzgxMDQ3MDYxMzA0MzE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bf03dcdfda032678a29549b5dd0adf81f4db6dc3587165b21df50a59594231f9 |
| hovercard-subject-tag | issue:1467478867 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-logging/677/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cd75d6694ab4dff2af7ce73b2186fdd46d65b7aab5a43860950211369859c88c/googleapis/python-logging/issues/677 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cd75d6694ab4dff2af7ce73b2186fdd46d65b7aab5a43860950211369859c88c/googleapis/python-logging/issues/677 |
| og:image:alt | 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.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tokibito |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-logging git https://github.com/googleapis/python-logging.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992562 |
| octolytics-dimension-repository_nwo | googleapis/python-logging |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992562 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-logging |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5741a45fe07e5f377d0d4c524a92e3056acc51bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width