Files

47 lines
1.9 KiB
Python
Raw Permalink Normal View History

2025-12-23 15:01:24 +05:30
from django.conf import settings
2024-10-10 15:45:44 +05:30
from django.urls import include, path
2025-12-23 15:01:24 +05:30
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from horilla_api.schema import OrderedTagSchemaGenerator
# Create schema view for Swagger and ReDoc
schema_view = get_schema_view(
openapi.Info(
title="Horilla API",
default_version="v1",
description="API documentation for Horilla HRMS. Click the 'Authorize' button at the top to authenticate.",
terms_of_service="https://www.horilla.com/terms/",
contact=openapi.Contact(email="contact@horilla.com"),
license=openapi.License(name="BSD License"),
),
public=True,
permission_classes=(permissions.AllowAny,),
generator_class=OrderedTagSchemaGenerator,
)
urlpatterns = [
2025-12-23 15:01:24 +05:30
# API Documentation URLs
path(
"swagger<format>/", schema_view.without_ui(cache_timeout=0), name="schema-json"
),
path(
"swagger/",
schema_view.with_ui("swagger", cache_timeout=0),
name="schema-swagger-ui",
),
path("redoc/", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"),
path("docs/", schema_view.with_ui("swagger", cache_timeout=0), name="schema-docs"),
# API Endpoints (static configuration)
2024-10-10 15:45:44 +05:30
path("auth/", include("horilla_api.api_urls.auth.urls")),
path("asset/", include("horilla_api.api_urls.asset.urls")),
path("base/", include("horilla_api.api_urls.base.urls")),
path("employee/", include("horilla_api.api_urls.employee.urls")),
path("notifications/", include("horilla_api.api_urls.notifications.urls")),
path("payroll/", include("horilla_api.api_urls.payroll.urls")),
path("attendance/", include("horilla_api.api_urls.attendance.urls")),
path("leave/", include("horilla_api.api_urls.leave.urls")),
path("helpdesk/", include("horilla_api.api_urls.helpdesk.urls")),
2024-10-10 15:45:44 +05:30
]