- Install and configure drf-spectacular for OpenAPI/Swagger documentation - Add Swagger UI endpoints at /api/schema/ and /api/docs/ - Configure SPECTACULAR_SETTINGS with API metadata - Refactor meetings views from function-based to class-based views (ScheduleAppointmentView, RejectAppointmentView, AvailableDatesView, UserAppointmentsView, AppointmentStatsView, UserAppointmentStatsView) - Update URL patterns to use new class-based views - Simplify ALLOWED_HOSTS configuration to accept all hosts This improves API discoverability through interactive documentation and modernizes the codebase by using class-based views for better code organization and reusability.
15 lines
562 B
Python
15 lines
562 B
Python
from django.urls import path, include
|
|
from django.contrib import admin
|
|
from .views import api_root
|
|
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
|
|
|
|
urlpatterns = [
|
|
path('admin/', admin.site.urls),
|
|
path('api/auth/', include('users.urls')),
|
|
path('api/meetings/', include('meetings.urls')),
|
|
path('', api_root, name='api-root'),
|
|
|
|
# Swagger UI endpoints
|
|
path('api/schema/', SpectacularAPIView.as_view(), name='schema'),
|
|
path('api/docs/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
|
|
] |