python - How to get APIViews and ViewSets to show on API Root when using Router with Django REST Framework? -


i started using drf , wondering how automatically generated api root provided router display endpoint routes don't come viewset-based views.

in case, have non-viewset (generic) class-based views (listapiview , retrieveapiview) in views.py appear in api root.

i open alternative solutions this, e.g. should abandon viewsets , implement endpoints differently, etc.

i think best way here to:

  • keep using preferred viewsets / generic* / mixins / bare views. real work happens.
  • rewrite apiroot-view (it not complex, see the source).
  • either use urlconfig or extend defaultrouter make drf use apiroot-view.

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -