Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

djangorestframework browsable api: how to show all available endpoints urls?

In djangorestframework, there is a browsable api. But how do I show a user an entire bird's eye view of all the possible API calls that he/she can make? I can only see one at a time right now and the user would have to already know the correct URL beforehand

i.e.,

http://localhost:8000/users
http://localhost:8000/books
http://localhost:8000/book/1/author

Thank you!

like image 436
user798719 Avatar asked Jan 30 '18 02:01

user798719


1 Answers

The answer is as Klahnen said. Use this:

https://django-rest-swagger.readthedocs.io/en/latest/

It works out of the box for me and it is exactly what I was hoping for. I still maintain, though, that the term browsable API implies that there is a table of contents available for consumers of your API to see. This app is a lifesaver and perhaps it should be included!

like image 71
user798719 Avatar answered Oct 23 '22 07:10

user798719