File tree Expand file tree Collapse file tree
infrastructure/common-images/cloudharness-django/libraries/cloudharness-django Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 []) + ['admin_extra_buttons' , ]
1616
1717# add the local apps
18- INSTALLED_APPS += ['cloudharness_django' , ]
18+ INSTALLED_APPS += ['cloudharness_django' , 'django_prometheus' ]
1919
2020# add the CloudHarness Django auto login middleware
21- MIDDLEWARE = getattr (
22- settings ,
23- 'MIDDLEWARE' ,
24- []
25- ) + [
26- 'cloudharness_django.middleware.BearerTokenMiddleware' ,
27- ]
21+ MIDDLEWARE = \
22+ ['django_prometheus.middleware.PrometheusBeforeMiddleware' ] + \
23+ getattr (
24+ settings ,
25+ 'MIDDLEWARE' ,
26+ []
27+ ) + \
28+ [
29+ 'cloudharness_django.middleware.BearerTokenMiddleware' ,
30+ 'django_prometheus.middleware.PrometheusAfterMiddleware'
31+ ]
2832
2933USER_CHANGE_ENABLED = False
3034
9296 },
9397 },
9498}
99+
100+ if settings .ROOT_URLCONF :
101+ APP_URLCONF = settings .ROOT_URLCONF
102+ ROOT_URLCONF = "cloudharness_django.urls"
Original file line number Diff line number Diff line change 1+ from django .conf import settings
2+ from django .urls import include , path
3+
4+
5+ urlpatterns = []
6+
7+ urlpatterns .append (path ('prometheus/' , include ('django_prometheus.urls' )))
8+ urlpatterns .append (path ('' , include (settings .APP_URLCONF )))
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ license = BSD-3-Clause
99classifiers =
1010 Environment :: Web Environment
1111 Framework :: Django
12- Framework :: Django :: 3.2
12+ Framework :: Django :: 3.0.7
1313 Intended Audience :: Developers
1414 License :: OSI Approved :: BSD License
1515 Operating System :: OS Independent
@@ -34,3 +34,4 @@ install_requires =
3434 psycopg2-binary>=2.9.3
3535 Pillow>=9.2.0
3636 python-keycloak
37+ django-prometheus
You can’t perform that action at this time.
0 commit comments