Coverage for dalima/urls.py: 85%

11 statements  

« prev     ^ index     » next       coverage.py v7.10.1, created at 2025-07-29 15:38 +0000

1""" 

2URL configuration for dalima project. 

3 

4The `urlpatterns` list routes URLs to views. For more information please see: 

5 https://docs.djangoproject.com/en/5.1/topics/http/urls/ 

6Examples: 

7Function views 

8 1. Add an import: from my_app import views 

9 2. Add a URL to urlpatterns: path("", views.home, name="home") 

10Class-based views 

11 1. Add an import: from other_app.views import Home 

12 2. Add a URL to urlpatterns: path("", Home.as_view(), name="home") 

13Including another URLconf 

14 1. Import the include() function: from django.urls import include, path 

15 2. Add a URL to urlpatterns: path("blog/", include("blog.urls")) 

16""" 

17 

18from django.conf import settings 

19from django.contrib import admin 

20from django.http import HttpRequest, HttpResponse 

21from django.urls import include, path 

22from django.views.generic.base import View 

23 

24 

25class HealthCheck(View): 

26 def get(self, _request: HttpRequest) -> HttpResponse: 

27 return HttpResponse("OK") 

28 

29 

30urlpatterns = [ 

31 path("admin/", admin.site.urls), 

32 path("", include("datacite.urls", namespace="datacite")), 

33 path("healthcheck/", HealthCheck.as_view(), name="healthcheck"), 

34] 

35 

36 

37if settings.DEBUG: 37 ↛ 38line 37 didn't jump to line 38 because the condition on line 37 was never true

38 urlpatterns.append(path("__debug__/", include("debug_toolbar.urls")))