diff --git a/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/settings.py b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/settings.py index d5df35168..8f9d5c8d4 100644 --- a/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/settings.py +++ b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/settings.py @@ -15,16 +15,20 @@ []) + ['admin_extra_buttons', ] # add the local apps -INSTALLED_APPS += ['cloudharness_django', ] +INSTALLED_APPS += ['cloudharness_django', 'django_prometheus'] # add the CloudHarness Django auto login middleware -MIDDLEWARE = getattr( - settings, - 'MIDDLEWARE', - [] -) + [ - 'cloudharness_django.middleware.BearerTokenMiddleware', -] +MIDDLEWARE = \ + ['django_prometheus.middleware.PrometheusBeforeMiddleware'] + \ + getattr( + settings, + 'MIDDLEWARE', + [] + ) + \ + [ + 'cloudharness_django.middleware.BearerTokenMiddleware', + 'django_prometheus.middleware.PrometheusAfterMiddleware' + ] USER_CHANGE_ENABLED = False @@ -92,3 +96,7 @@ }, }, } + +if settings.ROOT_URLCONF: + APP_URLCONF = settings.ROOT_URLCONF + ROOT_URLCONF = "cloudharness_django.urls" \ No newline at end of file diff --git a/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/urls.py b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/urls.py new file mode 100644 index 000000000..0b5641e4d --- /dev/null +++ b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/cloudharness_django/urls.py @@ -0,0 +1,8 @@ +from django.conf import settings +from django.urls import include, path + + +urlpatterns = [] + +urlpatterns.append(path('prometheus/', include('django_prometheus.urls'))) +urlpatterns.append(path('', include(settings.APP_URLCONF))) diff --git a/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/setup.cfg b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/setup.cfg index 5ca2ead8d..5ec4f2abb 100644 --- a/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/setup.cfg +++ b/infrastructure/common-images/cloudharness-django/libraries/cloudharness-django/setup.cfg @@ -9,7 +9,7 @@ license = BSD-3-Clause classifiers = Environment :: Web Environment Framework :: Django - Framework :: Django :: 3.2 + Framework :: Django :: 3.0.7 Intended Audience :: Developers License :: OSI Approved :: BSD License Operating System :: OS Independent @@ -34,3 +34,4 @@ install_requires = psycopg2-binary>=2.9.3 Pillow>=9.2.0 python-keycloak + django-prometheus