A Django Restframework router that can show APIViews and include other routers as navigable urls in the root view.
Project description
Django Browsable Router
A Django Restframework router that can show APIViews and include other routers as navigable urls in the root view.
class TestView(APIView):
...
class TestViewSet(ViewSet):
...
router_1 = APIRouter()
router_1.format_root_view("other_routes", "These are under a different route.")
router_1.register(r"view-1", TestView.as_view(), "view_1")
router_1.register(r"view-2", TestViewSet.as_view(), "view_2")
router_2 = APIRouter()
router_2.register(r"view-3", TestView.as_view(), "view_3")
router_2.navigation_routes = {
"route": router_1,
}
urlpatterns = [
path("api/", include(router_2.urls))
]
# API Root:
# """API root."""
#
# "route": "/api/route/"
# "view-3": "/api/view-3/"
#
# Other Routes:
# """These are under a different route."""
#
# "view-1": "/api/route/view-1/"
# "view-2": "/api/route/view-2/"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-browsable-router-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc9a7b5a5c72c3632d80f81f4c722388c3783ce6cb5410262b818f8326548c07 |
|
MD5 | 37deea7df7cadb582817bcc065bffed4 |
|
BLAKE2b-256 | a981f1a6936e19273acb1fbddbeb3c458dac84b467c50ce3f9a1818813ebdb57 |
Close
Hashes for django_browsable_router-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4241f99c40d063d48f99fd1de4ab56372183b7e21fcc97b88f6190bbc69a5a03 |
|
MD5 | 59e13ddd7ae95cd05fa556d928974ce8 |
|
BLAKE2b-256 | 47960b2570ce50f655721c178baed389b719e0df072f5efa188a636db894605f |