Repository navigation
API URL Routing
This page outlines how API URL routing is structured in The Wall API. It covers dynamic endpoint management and versioning.
The Wall API follows a centralized approach to URL management, ensuring consistency and maintainability.
-
All API endpoints are registered in
the_wall_api/urls.py, where each route is mapped to a corresponding view. -
Global URL configuration is handled in
config/urls.py, which includes API routes under the/api/v2/namespace. -
API paths are not hardcoded — they are dynamically retrieved from
api_utils.exposed_endpoints, allowing seamless modifications.
This structure ensures scalability and reduces redundancy, making the API easier to maintain and extend.
To avoid hardcoding URLs throughout the codebase, all API paths are centrally defined in api_utils.exposed_endpoints.
Each entry consists of:
- Path – The full API route, dynamically prefixed with the API version.
- Name – The identifier used in Django’s URL dispatcher, dynamically suffixed with the API version for uniqueness.
This approach provides several benefits:
✔ Single source of truth → Updates only require modifications in one place.
✔ Consistent API structure → Maintains uniform naming and path conventions.
✔ Scalability → Facilitates seamless adaptation to future API versions.
The API applies URL-based versioning, defined in settings.py, using DRF’s URLPathVersioning.
- The current supported version is
v2. - Future versions can be added by updating the
ALLOWED_VERSIONSlist insettings.py.
| Request URL | API Version |
|---|---|
/api/v2/wallconfig-files/upload/ |
v2 |
/api/v2/profiles/overview/3/ |
v2 |
This ensures a structured approach to API versioning, allowing seamless transitions between versions as the API evolves.
💡 More details can be found in the API Access Overview.
Next: Authentication (Djoser)
Back to: DRF Configuration
Return to Top
DTS Index
Home Page
📌 Notable Technical Sections
👤 Author
LinkedIn: Aleksandar Dimitrov
Yahoo: sasho_1983@yahoo.com