Something on the network polls /health (and /v1/models) every 30 seconds; the former now answers 200 with a database check instead of a 404, and django.request is limited to ERROR in the logging config so scanner 404s stop filling backend/logs/j621.log. Real server errors still log, and the dev server keeps printing every request to its console.
22 lines
760 B
Python
22 lines
760 B
Python
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.contrib import admin
|
|
from django.urls import include, path
|
|
|
|
from apps.core.views import HealthView
|
|
|
|
urlpatterns = [
|
|
path("admin/", admin.site.urls),
|
|
path("api/auth/", include("apps.accounts.urls")),
|
|
path("api/", include("apps.accounts.api_urls")),
|
|
path("api/", include("apps.core.urls")),
|
|
path("api/", include("apps.library.urls")),
|
|
path("api/", include("apps.follows.urls")),
|
|
# Liveness probe for uptime monitors (no /api prefix, no auth).
|
|
path("health", HealthView.as_view(), name="health"),
|
|
path("health/", HealthView.as_view()),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|