2024-07-08 11:44:39 -04:00
|
|
|
# travel/urls.py
|
|
|
|
|
|
|
|
from django.urls import include, path
|
|
|
|
from rest_framework.routers import DefaultRouter
|
2024-11-03 22:57:07 -05:00
|
|
|
from .views import CountryViewSet, RegionViewSet, VisitedRegionViewSet, regions_by_country, visits_by_country
|
2024-07-08 11:44:39 -04:00
|
|
|
|
|
|
|
router = DefaultRouter()
|
2024-07-23 11:56:33 -04:00
|
|
|
router.register(r'countries', CountryViewSet, basename='countries')
|
|
|
|
router.register(r'regions', RegionViewSet, basename='regions')
|
|
|
|
router.register(r'visitedregion', VisitedRegionViewSet, basename='visitedregion')
|
2024-07-08 11:44:39 -04:00
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
path('', include(router.urls)),
|
|
|
|
path('<str:country_code>/regions/', regions_by_country, name='regions-by-country'),
|
2024-11-03 22:57:07 -05:00
|
|
|
path('<str:country_code>/visits/', visits_by_country, name='visits-by-country')
|
2024-07-08 11:44:39 -04:00
|
|
|
]
|