From 080bebbb5d33f03b0c7d4981185597878621b1c4 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Wed, 25 Sep 2024 19:27:02 +0800 Subject: [PATCH] Move all URLs behind /api/v1/ --- backend/api/urls.py | 12 +++++++++++- backend/config/urls.py | 12 ------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/backend/api/urls.py b/backend/api/urls.py index e45f4fd..a11b671 100644 --- a/backend/api/urls.py +++ b/backend/api/urls.py @@ -1,13 +1,21 @@ from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.urls import path, include +from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView +from django.contrib import admin from config.settings import DEBUG, SERVE_MEDIA, MEDIA_ROOT urlpatterns = [ path('accounts/', include('accounts.urls')), path('subscriptions/', include('subscriptions.urls')), path('notifications/', include('notifications.urls')), path('billing/', include('billing.urls')), - path('stripe/', include('payments.urls')) + path('stripe/', include('payments.urls')), + path('admin/', admin.site.urls), + path('schema/', SpectacularAPIView.as_view(), name='schema'), + path('swagger/', + SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'), + path('redoc/', + SpectacularRedocView.as_view(url_name='schema'), name='redoc'), ] # URLs for local development @@ -15,3 +23,5 @@ if DEBUG and SERVE_MEDIA: urlpatterns += staticfiles_urlpatterns() urlpatterns += static( 'media/', document_root=MEDIA_ROOT) +if DEBUG: + urlpatterns += [path('silk/', include('silk.urls', namespace='silk'))] diff --git a/backend/config/urls.py b/backend/config/urls.py index 46857a8..4bb0a88 100644 --- a/backend/config/urls.py +++ b/backend/config/urls.py @@ -1,17 +1,5 @@ -from django.contrib import admin from django.urls import path, include -from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView -from config.settings import DEBUG urlpatterns = [ - path('admin/', admin.site.urls), path('api/v1/', include('api.urls')), - path('schema/', SpectacularAPIView.as_view(), name='schema'), - path('swagger/', - SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'), - path('redoc/', - SpectacularRedocView.as_view(url_name='schema'), name='redoc'), ] - -if DEBUG: - urlpatterns += [path('silk/', include('silk.urls', namespace='silk'))]