Skip to main content

Hybrid DRF Router

Project description

DRF Hybdrid Router

Install the package

pip install tms_django_router

The router can be instanciate this way:

from tms_django_router.routers import HybridRouter

router = HybridRouter()

Then it can use the same register method than the original DRF DefaultRouter

from tms_django_router.routers import HybridRouter
from mypackage import views

router = routers.HybridRouter()

router.register(r"endpoint", views.MyViewSet)

And provides a way to add api view to DRF browsable api without using viewsets:

from django.urls import path

router.add_api_view(
    "another",
    path(
        "version/",
        views.MyView.as_view(),
        name="another",
    ),
)

Then the urls can be included the same way than DefaultRouter:

from django.urls import include

urls = [
    path("api/", include(router.urls))
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tms_django_router-1.0.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tms_django_router-1.0.2-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file tms_django_router-1.0.2.tar.gz.

File metadata

  • Download URL: tms_django_router-1.0.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tms_django_router-1.0.2.tar.gz
Algorithm Hash digest
SHA256 ebb4417809c937c20fd2cc1026c97e1b89def948b378491d5ceb9acac0f097d8
MD5 f0c92c975b818fc5c78df99af40abbe3
BLAKE2b-256 7684fb6b2d7fd19169a912363a2d006817315a9d1253d0205bfd708ce028e0e3

See more details on using hashes here.

File details

Details for the file tms_django_router-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: tms_django_router-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tms_django_router-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed098515f40b2350328b200841dbb26ce1fadb95c5df016b696ddf3c36af9d80
MD5 5976874e8f3f619529b4bbe46b7b87f1
BLAKE2b-256 3df6c24e89ff28e643febc19a41ab06edeff81004932338c376fccee37ca5fb1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page