prometheus basics and aws fix

This commit is contained in:
vabene1111
2021-06-05 14:41:32 +02:00
parent 8181a6d416
commit c83eb1a42b
4 changed files with 20 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin
from django.urls import include, path, re_path
from django.views.i18n import JavaScriptCatalog
@@ -33,6 +34,9 @@ urlpatterns = [
),
]
if settings.ENABLE_METRICS:
urlpatterns += url('', include('django_prometheus.urls')),
if settings.GUNICORN_MEDIA or settings.DEBUG:
urlpatterns += re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),
urlpatterns += re_path(r'^jsreverse.json$', reverse_views.urls_js, name='js_reverse'),