django-structlog 8.1.0__tar.gz → 9.0.0.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {django_structlog-8.1.0/django_structlog.egg-info → django_structlog-9.0.0.dev2}/PKG-INFO +4 -3
  2. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/__init__.py +1 -1
  3. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/middlewares/request.py +8 -0
  4. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2/django_structlog.egg-info}/PKG-INFO +4 -3
  5. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/pyproject.toml +12 -8
  6. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/LICENSE.rst +0 -0
  7. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/MANIFEST.in +0 -0
  8. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/README.rst +0 -0
  9. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/app_settings.py +0 -0
  10. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/apps.py +0 -0
  11. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/celery/__init__.py +0 -0
  12. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/celery/receivers.py +0 -0
  13. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/celery/signals.py +0 -0
  14. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/celery/steps.py +0 -0
  15. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/commands.py +0 -0
  16. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/middlewares/__init__.py +0 -0
  17. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog/signals.py +0 -0
  18. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog.egg-info/SOURCES.txt +0 -0
  19. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog.egg-info/dependency_links.txt +0 -0
  20. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog.egg-info/requires.txt +0 -0
  21. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/django_structlog.egg-info/top_level.txt +0 -0
  22. {django_structlog-8.1.0 → django_structlog-9.0.0.dev2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-structlog
3
- Version: 8.1.0
3
+ Version: 9.0.0.dev2
4
4
  Summary: Structured Logging for Django
5
5
  Author-email: Jules Robichaud-Gagnon <j.robichaudg+pypi@gmail.com>
6
6
  License: MIT
@@ -13,17 +13,18 @@ Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Framework :: Django
14
14
  Classifier: Framework :: Django :: 4.2
15
15
  Classifier: Framework :: Django :: 5.0
16
+ Classifier: Framework :: Django :: 5.1
16
17
  Classifier: Programming Language :: Python :: 3
17
18
  Classifier: Programming Language :: Python :: 3 :: Only
18
- Classifier: Programming Language :: Python :: 3.8
19
19
  Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
23
24
  Classifier: Topic :: System :: Logging
24
25
  Classifier: License :: OSI Approved :: MIT License
25
26
  Classifier: Operating System :: OS Independent
26
- Requires-Python: >=3.8
27
+ Requires-Python: >=3.9
27
28
  Description-Content-Type: text/x-rst
28
29
  License-File: LICENSE.rst
29
30
  Requires-Dist: django>=4.2
@@ -3,6 +3,6 @@
3
3
 
4
4
  name = "django_structlog"
5
5
 
6
- VERSION = (8, 1, 0)
6
+ VERSION = (9, 0, 0, "dev2")
7
7
 
8
8
  __version__ = ".".join(str(v) for v in VERSION)
@@ -1,10 +1,12 @@
1
1
  import asyncio
2
2
  import logging
3
+ import sys
3
4
  import uuid
4
5
 
5
6
  import structlog
6
7
  from asgiref.sync import iscoroutinefunction, markcoroutinefunction
7
8
  from django.core.exceptions import PermissionDenied
9
+ from django.core.signals import got_request_exception
8
10
  from django.http import Http404, StreamingHttpResponse
9
11
  from asgiref import sync
10
12
 
@@ -65,6 +67,7 @@ class RequestMiddleware:
65
67
  self.get_response = get_response
66
68
  if iscoroutinefunction(self.get_response):
67
69
  markcoroutinefunction(self)
70
+ got_request_exception.connect(self.process_got_request_exception)
68
71
 
69
72
  def __call__(self, request):
70
73
  if iscoroutinefunction(self):
@@ -74,6 +77,11 @@ class RequestMiddleware:
74
77
  self.handle_response(request, response)
75
78
  return response
76
79
 
80
+ def process_got_request_exception(self, sender, request, **kwargs):
81
+ if not hasattr(request, "_raised_exception"):
82
+ ex = sys.exc_info()
83
+ self.process_exception(request, ex[1])
84
+
77
85
  async def __acall__(self, request):
78
86
  await sync.sync_to_async(self.prepare)(request)
79
87
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-structlog
3
- Version: 8.1.0
3
+ Version: 9.0.0.dev2
4
4
  Summary: Structured Logging for Django
5
5
  Author-email: Jules Robichaud-Gagnon <j.robichaudg+pypi@gmail.com>
6
6
  License: MIT
@@ -13,17 +13,18 @@ Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Framework :: Django
14
14
  Classifier: Framework :: Django :: 4.2
15
15
  Classifier: Framework :: Django :: 5.0
16
+ Classifier: Framework :: Django :: 5.1
16
17
  Classifier: Programming Language :: Python :: 3
17
18
  Classifier: Programming Language :: Python :: 3 :: Only
18
- Classifier: Programming Language :: Python :: 3.8
19
19
  Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
23
24
  Classifier: Topic :: System :: Logging
24
25
  Classifier: License :: OSI Approved :: MIT License
25
26
  Classifier: Operating System :: OS Independent
26
- Requires-Python: >=3.8
27
+ Requires-Python: >=3.9
27
28
  Description-Content-Type: text/x-rst
28
29
  License-File: LICENSE.rst
29
30
  Requires-Dist: django>=4.2
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
10
10
  ]
11
11
  readme = "README.rst"
12
12
  dynamic = ["version"]
13
- requires-python = ">=3.8"
13
+ requires-python = ">=3.9"
14
14
  license = { text = "MIT" }
15
15
  dependencies = [
16
16
  "django>=4.2",
@@ -23,13 +23,14 @@ build-backend = "setuptools.build_meta"
23
23
  "Framework :: Django",
24
24
  "Framework :: Django :: 4.2",
25
25
  "Framework :: Django :: 5.0",
26
+ "Framework :: Django :: 5.1",
26
27
  "Programming Language :: Python :: 3",
27
28
  "Programming Language :: Python :: 3 :: Only",
28
- "Programming Language :: Python :: 3.8",
29
29
  "Programming Language :: Python :: 3.9",
30
30
  "Programming Language :: Python :: 3.10",
31
31
  "Programming Language :: Python :: 3.11",
32
32
  "Programming Language :: Python :: 3.12",
33
+ "Programming Language :: Python :: 3.13",
33
34
  "Topic :: System :: Logging",
34
35
  "License :: OSI Approved :: MIT License",
35
36
  "Operating System :: OS Independent",
@@ -62,11 +63,11 @@ build-backend = "setuptools.build_meta"
62
63
  [tool.black]
63
64
  line-length = 88
64
65
  target-version = [
65
- 'py38',
66
66
  'py39',
67
67
  'py310',
68
68
  'py311',
69
69
  'py312',
70
+ 'py313',
70
71
  ]
71
72
  include = '\.pyi?$'
72
73
  exclude = '''
@@ -84,7 +85,7 @@ build-backend = "setuptools.build_meta"
84
85
 
85
86
  [tool.ruff]
86
87
  line-length = 88
87
- target-version = "py312"
88
+ target-version = "py313"
88
89
  lint.ignore = [
89
90
  'E501',
90
91
  ]
@@ -99,17 +100,18 @@ build-backend = "setuptools.build_meta"
99
100
  #
100
101
  # Also, make sure that all python versions used here are included in ./github/worksflows/main.yml
101
102
  envlist =
102
- py{38,39,310,311}-django42-celery5{2,3}-redis{3,4}-kombu5,
103
- py31{0,1}-django50-celery53-redis4-kombu5,
104
- py312-django{42,50}-celery53-redis4-kombu5,
103
+ py{39,310,311}-django42-celery5{2,3}-redis{3,4}-kombu5,
104
+ py31{0,1}-django5{0,1}-celery5{3,4}-redis4-kombu5,
105
+ py312-django{42,50,51}-celery5{3,4}-redis4-kombu5,
106
+ py313-django{51}-celery5{3,4}-redis4-kombu5,
105
107
 
106
108
  [gh-actions]
107
109
  python =
108
- 3.8: py38
109
110
  3.9: py39
110
111
  3.10: py310
111
112
  3.11: py311
112
113
  3.12: py312
114
+ 3.13: py313
113
115
 
114
116
  [testenv]
115
117
  setenv =
@@ -125,8 +127,10 @@ build-backend = "setuptools.build_meta"
125
127
  celery51: Celery >=5.1, <5.2
126
128
  celery52: Celery >=5.2, <5.3
127
129
  celery53: Celery >=5.3, <5.4
130
+ celery54: Celery >=5.4, <5.5
128
131
  django42: Django >=4.2, <5.0
129
132
  django50: Django >=5.0, <5.1
133
+ django51: Django >=5.1, <5.2
130
134
  -r{toxinidir}/requirements/ci.txt
131
135
 
132
136
  commands = pytest --cov=./test_app --cov=./django_structlog --cov-append test_app