mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-02 19:55:18 +02:00
chore: Add GeoJSON endpoint to retrieve combined GeoJSON data from static files
This commit is contained in:
parent
70d08eff8a
commit
57eee7bb5d
4 changed files with 83 additions and 25 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
from django.urls import include, path
|
||||
from rest_framework.routers import DefaultRouter
|
||||
from .views import CountryViewSet, RegionViewSet, VisitedRegionViewSet, regions_by_country, visits_by_country
|
||||
from .views import CountryViewSet, RegionViewSet, VisitedRegionViewSet, regions_by_country, visits_by_country, GeoJSONView
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register(r'countries', CountryViewSet, basename='countries')
|
||||
|
@ -13,4 +13,5 @@ urlpatterns = [
|
|||
path('', include(router.urls)),
|
||||
path('<str:country_code>/regions/', regions_by_country, name='regions-by-country'),
|
||||
path('<str:country_code>/visits/', visits_by_country, name='visits-by-country'),
|
||||
path('geojson/', GeoJSONView.as_view({'get': 'list'}), name='geojson'),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue