Coverage for config/urls.py: 100.00%
10 statements
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-24 10:40 -0700
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-24 10:40 -0700
1from django.conf import settings 1a
2from django.conf.urls.static import static 1a
3from django.contrib import admin 1a
4from django.urls import include, path 1a
5from drf_yasg import openapi 1a
6from drf_yasg.views import get_schema_view 1a
7from rest_framework import permissions 1a
9schema_view = get_schema_view( 1a
10 openapi.Info(
11 title="Blog API",
12 default_version="v1",
13 description="A sample API for learning DRF",
14 terms_of_service="https://www.google.com/policies/terms/",
15 contact=openapi.Contact(email="kevin.bowen@gmail.com"),
16 license=openapi.License(name="MIT License"),
17 ),
18 public=True,
19 permission_classes=(permissions.AllowAny,),
20)
22urlpatterns = [ 1a
23 # Django admin
24 path("admin/doc/", include("django.contrib.admindocs.urls")),
25 path("resources/", admin.site.urls),
26 # User management
27 path("accounts/", include("allauth.urls")),
28 # Local apps
29 path("accounts/", include("accounts.urls")),
30 path("", include("pages.urls")),
31 path("api/v1/", include("posts.urls")),
32 path("", include("posts.urls")),
33 path("api-auth/", include("rest_framework.urls")),
34 path("api/v1/dj-rest-auth/", include("dj_rest_auth.urls")),
35 path(
36 "api/v1/dj-rest-auth/registration/",
37 include("dj_rest_auth.registration.urls"),
38 ),
39 path(
40 "api/schema/swagger-ui/",
41 schema_view.with_ui("swagger", cache_timeout=0),
42 name="swagger-ui",
43 ),
44 path(
45 "api/schema/redoc/",
46 schema_view.with_ui("redoc", cache_timeout=0),
47 name="redoc",
48 ),
49] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
51""" 1a
52if settings.DEBUG:
53 import debug_toolbar # noqa: F401
55 urlpatterns = [
56 path("__debug__/", include(debug_toolbar.urls)),
57 ] + urlpatterns
58"""