From a918b4ae7c2569c7abb8a23063d349c18ffdd5e6 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Wed, 9 Oct 2024 22:30:48 -0300 Subject: [PATCH] feat: add api --- app/WYGIWYH/urls.py | 13 ++++++++++++- app/apps/monthly_overview/urls.py | 1 + app/apps/transactions/urls.py | 3 +-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/WYGIWYH/urls.py b/app/WYGIWYH/urls.py index aaa187c..ef8e8f3 100644 --- a/app/WYGIWYH/urls.py +++ b/app/WYGIWYH/urls.py @@ -17,13 +17,24 @@ Including another URLconf from django.contrib import admin from django.urls import path, include +from drf_spectacular.views import ( + SpectacularAPIView, + SpectacularSwaggerView, +) urlpatterns = [ path("admin/", admin.site.urls), path("hijack/", include("hijack.urls")), path("__debug__/", include("debug_toolbar.urls")), path("__reload__/", include("django_browser_reload.urls")), - path("api/", include("rest_framework.urls")), + # path("api/", include("rest_framework.urls")), + path("api/", include("apps.api.urls")), + path("api/schema/", SpectacularAPIView.as_view(), name="schema"), + path( + "api/docs/", + SpectacularSwaggerView.as_view(url_name="schema"), + name="swagger-ui", + ), path("", include("apps.transactions.urls")), path("", include("apps.common.urls")), path("", include("apps.users.urls")), diff --git a/app/apps/monthly_overview/urls.py b/app/apps/monthly_overview/urls.py index 0f9e476..41e21a0 100644 --- a/app/apps/monthly_overview/urls.py +++ b/app/apps/monthly_overview/urls.py @@ -4,6 +4,7 @@ from . import views urlpatterns = [ path("monthly/", views.index, name="monthly_index"), + path("", views.index, name="monthly_index"), path( "monthly///transactions/list/", views.transactions_list, diff --git a/app/apps/transactions/urls.py b/app/apps/transactions/urls.py index ece823a..ce80380 100644 --- a/app/apps/transactions/urls.py +++ b/app/apps/transactions/urls.py @@ -1,6 +1,5 @@ from django.urls import path - -from . import views +import apps.transactions.views as views urlpatterns = [ path(