django-cfg 1.4.66__py3-none-any.whl → 1.4.68__py3-none-any.whl
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.
Potentially problematic release.
This version of django-cfg might be problematic. Click here for more details.
- django_cfg/__init__.py +1 -1
- django_cfg/apps/centrifugo/views/testing_api.py +4 -1
- django_cfg/modules/django_dashboard/sections/widgets.py +36 -23
- django_cfg/pyproject.toml +1 -5
- {django_cfg-1.4.66.dist-info → django_cfg-1.4.68.dist-info}/METADATA +1 -1
- {django_cfg-1.4.66.dist-info → django_cfg-1.4.68.dist-info}/RECORD +9 -9
- {django_cfg-1.4.66.dist-info → django_cfg-1.4.68.dist-info}/WHEEL +0 -0
- {django_cfg-1.4.66.dist-info → django_cfg-1.4.68.dist-info}/entry_points.txt +0 -0
- {django_cfg-1.4.66.dist-info → django_cfg-1.4.68.dist-info}/licenses/LICENSE +0 -0
django_cfg/__init__.py
CHANGED
|
@@ -126,7 +126,10 @@ class CentrifugoTestingAPIViewSet(viewsets.ViewSet):
|
|
|
126
126
|
base_url = config.wrapper_url.rstrip("/")
|
|
127
127
|
|
|
128
128
|
self._http_client = httpx.AsyncClient(
|
|
129
|
-
base_url=base_url,
|
|
129
|
+
base_url=base_url,
|
|
130
|
+
headers=headers,
|
|
131
|
+
timeout=httpx.Timeout(30.0),
|
|
132
|
+
verify=False, # Allow self-signed certificates
|
|
130
133
|
)
|
|
131
134
|
|
|
132
135
|
return self._http_client
|
|
@@ -87,10 +87,10 @@ class WidgetsSection(DataSection):
|
|
|
87
87
|
metrics_data = {}
|
|
88
88
|
metrics_data.update(self.get_system_metrics())
|
|
89
89
|
|
|
90
|
-
# Add
|
|
90
|
+
# Add Centrifugo metrics if enabled
|
|
91
91
|
dashboard_manager = self._get_dashboard_manager()
|
|
92
|
-
if dashboard_manager.
|
|
93
|
-
metrics_data.update(self.
|
|
92
|
+
if dashboard_manager.is_centrifugo_enabled():
|
|
93
|
+
metrics_data.update(self.get_centrifugo_metrics())
|
|
94
94
|
|
|
95
95
|
# Also merge any custom metrics from kwargs
|
|
96
96
|
custom_metrics = kwargs.get('custom_metrics', {})
|
|
@@ -169,41 +169,54 @@ class WidgetsSection(DataSection):
|
|
|
169
169
|
'disk_percent': round(psutil.disk_usage('/').percent, 1),
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
def
|
|
173
|
-
"""Get
|
|
172
|
+
def get_centrifugo_metrics(self) -> Dict[str, Any]:
|
|
173
|
+
"""Get Centrifugo metrics for widgets."""
|
|
174
174
|
try:
|
|
175
|
-
from django_cfg.apps.
|
|
175
|
+
from django_cfg.apps.centrifugo.models import CentrifugoLog
|
|
176
176
|
|
|
177
177
|
# Get stats for last 24 hours
|
|
178
178
|
since = timezone.now() - timedelta(hours=24)
|
|
179
179
|
|
|
180
|
-
logs =
|
|
180
|
+
logs = CentrifugoLog.objects.filter(created_at__gte=since)
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
total_publishes = logs.count()
|
|
183
|
+
successful_publishes = logs.filter(status='success').count()
|
|
184
|
+
failed_publishes = logs.filter(status='failed').count()
|
|
185
|
+
timeout_publishes = logs.filter(status='timeout').count()
|
|
185
186
|
|
|
186
|
-
success_rate = round((
|
|
187
|
+
success_rate = round((successful_publishes / total_publishes * 100) if total_publishes > 0 else 0, 1)
|
|
187
188
|
|
|
188
189
|
avg_duration = logs.filter(
|
|
189
|
-
|
|
190
|
+
duration_ms__isnull=False
|
|
190
191
|
).aggregate(
|
|
191
|
-
avg=Avg('
|
|
192
|
+
avg=Avg('duration_ms')
|
|
192
193
|
)['avg']
|
|
193
194
|
|
|
194
|
-
avg_duration = round(avg_duration
|
|
195
|
+
avg_duration = round(avg_duration, 1) if avg_duration else 0 # Already in ms
|
|
196
|
+
|
|
197
|
+
avg_acks = logs.filter(
|
|
198
|
+
acks_received__isnull=False
|
|
199
|
+
).aggregate(
|
|
200
|
+
avg=Avg('acks_received')
|
|
201
|
+
)['avg']
|
|
202
|
+
|
|
203
|
+
avg_acks = round(avg_acks, 1) if avg_acks else 0
|
|
195
204
|
|
|
196
205
|
return {
|
|
197
|
-
'
|
|
198
|
-
'
|
|
199
|
-
'
|
|
200
|
-
'
|
|
206
|
+
'centrifugo_total_publishes': total_publishes,
|
|
207
|
+
'centrifugo_success_rate': success_rate,
|
|
208
|
+
'centrifugo_avg_duration': avg_duration,
|
|
209
|
+
'centrifugo_failed_publishes': failed_publishes,
|
|
210
|
+
'centrifugo_timeout_publishes': timeout_publishes,
|
|
211
|
+
'centrifugo_avg_acks': avg_acks,
|
|
201
212
|
}
|
|
202
213
|
except Exception as e:
|
|
203
|
-
# Return zeros if
|
|
214
|
+
# Return zeros if Centrifugo models not available
|
|
204
215
|
return {
|
|
205
|
-
'
|
|
206
|
-
'
|
|
207
|
-
'
|
|
208
|
-
'
|
|
216
|
+
'centrifugo_total_publishes': 0,
|
|
217
|
+
'centrifugo_success_rate': 0,
|
|
218
|
+
'centrifugo_avg_duration': 0,
|
|
219
|
+
'centrifugo_failed_publishes': 0,
|
|
220
|
+
'centrifugo_timeout_publishes': 0,
|
|
221
|
+
'centrifugo_avg_acks': 0,
|
|
209
222
|
}
|
django_cfg/pyproject.toml
CHANGED
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "django-cfg"
|
|
7
|
-
version = "1.4.
|
|
7
|
+
version = "1.4.68"
|
|
8
8
|
description = "Django AI framework with built-in agents, type-safe Pydantic v2 configuration, and 8 enterprise apps. Replace settings.py, validate at startup, 90% less code. Production-ready AI workflows for Django."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
keywords = [ "django", "configuration", "pydantic", "settings", "type-safety", "pydantic-settings", "django-environ", "startup-validation", "ide-autocomplete", "ai-agents", "enterprise-django", "django-settings", "type-safe-config",]
|
|
@@ -137,10 +137,6 @@ exclude = [ "scripts/",]
|
|
|
137
137
|
include = [ "src/django_cfg", "README.md", "LICENSE", "CHANGELOG.md", "CONTRIBUTING.md", "requirements*.txt", "MANIFEST.in",]
|
|
138
138
|
exclude = [ "@*", "tests", "scripts", "*.log", ".env*",]
|
|
139
139
|
|
|
140
|
-
[tool.poetry.group.local.dependencies.django-ipc]
|
|
141
|
-
path = "/Users/markinmatrix/djangoipc"
|
|
142
|
-
develop = true
|
|
143
|
-
|
|
144
140
|
[tool.hatch.build.targets.wheel.force-include]
|
|
145
141
|
LICENSE = "django_cfg/LICENSE"
|
|
146
142
|
"CONTRIBUTING.md" = "django_cfg/CONTRIBUTING.md"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: django-cfg
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.68
|
|
4
4
|
Summary: Django AI framework with built-in agents, type-safe Pydantic v2 configuration, and 8 enterprise apps. Replace settings.py, validate at startup, 90% less code. Production-ready AI workflows for Django.
|
|
5
5
|
Project-URL: Homepage, https://djangocfg.com
|
|
6
6
|
Project-URL: Documentation, https://djangocfg.com
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
django_cfg/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
django_cfg/__init__.py,sha256=
|
|
2
|
+
django_cfg/__init__.py,sha256=01YjHYbMRTE1MYRey2WB9S10vTJ1L97GsU1AGln0BFM,1620
|
|
3
3
|
django_cfg/apps.py,sha256=72m3uuvyqGiLx6gOfE-BD3P61jddCCERuBOYpxTX518,1605
|
|
4
4
|
django_cfg/config.py,sha256=y4Z3rnYsHBE0TehpwAIPaxr---mkvyKrZGGsNwYso74,1398
|
|
5
5
|
django_cfg/apps/__init__.py,sha256=JtDmEYt1OcleWM2ZaeX0LKDnRQzPOavfaXBWG4ECB5Q,26
|
|
@@ -209,7 +209,7 @@ django_cfg/apps/centrifugo/views/__init__.py,sha256=k4gAQehwJOF6RE-wqgEISdtTRjT4
|
|
|
209
209
|
django_cfg/apps/centrifugo/views/admin_api.py,sha256=N6rJx2cXo6IxkLdo2C9bpOGjTg-9ZQ7TaGLfJITVa6I,13968
|
|
210
210
|
django_cfg/apps/centrifugo/views/dashboard.py,sha256=Xl8wseEy_NfdKl8ITe9AFOJSCpLxqEY70mouUGywgDI,423
|
|
211
211
|
django_cfg/apps/centrifugo/views/monitoring.py,sha256=YVDMB-zsTgznijloxpRBZoyixTZZ99y5q003klo_y3A,10006
|
|
212
|
-
django_cfg/apps/centrifugo/views/testing_api.py,sha256=
|
|
212
|
+
django_cfg/apps/centrifugo/views/testing_api.py,sha256=Z-UquKBdtXO8jFsTVB-tVCrViYy9UTG3tdiSOR2bzRs,14865
|
|
213
213
|
django_cfg/apps/knowbase/README.md,sha256=HXt_J6WCN-LsMhA7p9mdvih07_vp_r_hkPdmqHhNEeo,3965
|
|
214
214
|
django_cfg/apps/knowbase/__init__.py,sha256=cfGnxDQwjajPhUoleKkgvdabJcB0LdXEglnsBojKkPo,1045
|
|
215
215
|
django_cfg/apps/knowbase/apps.py,sha256=GAYw98_rQdGHoak58xN-0vjdDcRNpJuND3kV-FfM1II,3290
|
|
@@ -863,7 +863,7 @@ django_cfg/modules/django_dashboard/sections/documentation.py,sha256=rpBRGhawCay
|
|
|
863
863
|
django_cfg/modules/django_dashboard/sections/overview.py,sha256=Gfgl55d9S9ohzDJ_UxxCP7ny6NbbhfZ24l1uAs0PEc0,13391
|
|
864
864
|
django_cfg/modules/django_dashboard/sections/stats.py,sha256=5k2DKr_87Os0H8Wd_hU3sIcAq799OOnjApJ14hDF-gc,1282
|
|
865
865
|
django_cfg/modules/django_dashboard/sections/system.py,sha256=3zAfms02qB2zSQt3BjBYKw-JlLTjaj0A6qciqYOKNMo,2026
|
|
866
|
-
django_cfg/modules/django_dashboard/sections/widgets.py,sha256=
|
|
866
|
+
django_cfg/modules/django_dashboard/sections/widgets.py,sha256=m9X8lxdnnqP5P8343gqHJaztaMAg3D2dUlIc3TCkGOM,8323
|
|
867
867
|
django_cfg/modules/django_drf_theme/__init__.py,sha256=0D5ctzcjadbw-z7jpvVjvo8C1ufrGRk6b-mA4xSutTE,525
|
|
868
868
|
django_cfg/modules/django_drf_theme/apps.py,sha256=UzcjnTQyMqExKGwhg5KhCK0eEqgGXtaYbCztHd_V2pw,428
|
|
869
869
|
django_cfg/modules/django_drf_theme/renderers.py,sha256=AVlXpepI62iHcZhbGAsLwtXpnQ8NeN0zyWQbePUnN3w,1808
|
|
@@ -1103,9 +1103,9 @@ django_cfg/utils/version_check.py,sha256=WO51J2m2e-wVqWCRwbultEwu3q1lQasV67Mw2aa
|
|
|
1103
1103
|
django_cfg/CHANGELOG.md,sha256=jtT3EprqEJkqSUh7IraP73vQ8PmKUMdRtznQsEnqDZk,2052
|
|
1104
1104
|
django_cfg/CONTRIBUTING.md,sha256=DU2kyQ6PU0Z24ob7O_OqKWEYHcZmJDgzw-lQCmu6uBg,3041
|
|
1105
1105
|
django_cfg/LICENSE,sha256=xHuytiUkSZCRG3N11nk1X6q1_EGQtv6aL5O9cqNRhKE,1071
|
|
1106
|
-
django_cfg/pyproject.toml,sha256
|
|
1107
|
-
django_cfg-1.4.
|
|
1108
|
-
django_cfg-1.4.
|
|
1109
|
-
django_cfg-1.4.
|
|
1110
|
-
django_cfg-1.4.
|
|
1111
|
-
django_cfg-1.4.
|
|
1106
|
+
django_cfg/pyproject.toml,sha256=-S8_HvOjkivyMoF09lf0uDIa2zMnSOF26RVQQNaC_lg,8155
|
|
1107
|
+
django_cfg-1.4.68.dist-info/METADATA,sha256=erIG57bJzKLO4lXI5tY04Oq-rPG43zvO2MjncXu-ucA,22589
|
|
1108
|
+
django_cfg-1.4.68.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
1109
|
+
django_cfg-1.4.68.dist-info/entry_points.txt,sha256=Ucmde4Z2wEzgb4AggxxZ0zaYDb9HpyE5blM3uJ0_VNg,56
|
|
1110
|
+
django_cfg-1.4.68.dist-info/licenses/LICENSE,sha256=xHuytiUkSZCRG3N11nk1X6q1_EGQtv6aL5O9cqNRhKE,1071
|
|
1111
|
+
django_cfg-1.4.68.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|