61 lines
2.4 KiB
Python
61 lines
2.4 KiB
Python
from django.contrib import admin
|
|
from django.urls import path, include
|
|
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView
|
|
|
|
urlpatterns = [
|
|
path('admin/', admin.site.urls),
|
|
path('api/', include('api.urls')), # API endpoints
|
|
path('users/', include('users.urls')), # User management app
|
|
path('links/', include('links.urls')), # Link management app
|
|
path('customization/', include('customization.urls')), # Design customization app
|
|
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
|
|
|
|
# Summary of API Endpoints:
|
|
# POST /api/auth/register/ - Register new user
|
|
# POST /api/auth/login/ - Obtain JWT tokens (access & refresh)
|
|
# GET /api/users/<username>/links/ - Public list of user's links
|
|
# GET /api/links/ - List authenticated user's links
|
|
# POST /api/links/ - Create a new link
|
|
# GET /api/links/{id}/ - Retrieve a specific link
|
|
# PUT /api/links/{id}/ - Update a specific link
|
|
# PATCH /api/links/{id}/ - Partially update a link
|
|
# DELETE /api/links/{id}/ - Delete a specific link
|
|
# GET /api/groups/ - List authenticated user's link groups
|
|
# POST /api/groups/ - Create a new link group
|
|
# GET /api/groups/{id}/ - Retrieve a specific link group
|
|
# PUT /api/groups/{id}/ - Update a link group
|
|
# PATCH /api/groups/{id}/ - Partially update a link group
|
|
# DELETE /api/groups/{id}/ - Delete a specific link group
|
|
|
|
# To avoid URL configuration errors, ensure the following placeholder URLConfs exist:
|
|
# users/urls.py
|
|
# ----------------
|
|
# from django.urls import path, include
|
|
#
|
|
# urlpatterns = [
|
|
# # Define user-management endpoints here (e.g., profile, settings)
|
|
# ]
|
|
|
|
# links/urls.py
|
|
# ----------------
|
|
# from django.urls import path, include
|
|
#
|
|
# urlpatterns = [
|
|
# # Define additional link-management endpoints here if needed
|
|
# ]
|
|
|
|
# customization/urls.py
|
|
# ----------------
|
|
# from django.urls import path, include
|
|
#
|
|
# urlpatterns = [
|
|
# # Define design customization endpoints here
|
|
# ]
|