Reputation: 1867
This is my urlpatterns in base urls.py,
urlpatterns = [
path('api/', include((router.urls, 'api'), namespace='api')),
]
when I browse to localhost:8000/api/
, it exposes all my routes,
{
"accounts": "http://localhost:8000/api/accounts/",
"cases":"http://localhost:8000/api/cases/",
"issues": "http://localhost:8000/api/issues/"
}
Is there any way I can disable this exposing on django application level?
Upvotes: 0
Views: 377
Reputation: 20976
You should use SimpleRouter
instead of DefaultRouter
. The latter adds the view to the routing provided by the former.
Upvotes: 2