2024-10-05 17:30:35 +02:00
|
|
|
# catalog/urls.py
|
|
|
|
|
|
2024-11-18 01:27:23 +01:00
|
|
|
from django.http import HttpResponseRedirect
|
2024-10-05 17:30:35 +02:00
|
|
|
from django.urls import path
|
2024-12-22 03:07:07 +01:00
|
|
|
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
|
2024-10-05 17:30:35 +02:00
|
|
|
from .api_views import PlantListCreateAPIView, PlantRetrieveUpdateDestroyAPIView
|
|
|
|
|
|
|
|
|
|
urlpatterns = [
|
2024-11-18 01:27:23 +01:00
|
|
|
path('', lambda request: HttpResponseRedirect('/api/plants/')),
|
2024-10-05 17:30:35 +02:00
|
|
|
path('api/plants/', PlantListCreateAPIView.as_view(), name='plant_list_create'), # List and Create
|
|
|
|
|
path('api/plants/<int:pk>/', PlantRetrieveUpdateDestroyAPIView.as_view(), name='plant_detail_update_delete'), # Retrieve, Update, Delete
|
2024-12-22 03:07:07 +01:00
|
|
|
path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
|
|
|
|
path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|