use*_*719 8 django django-rest-framework
在 djangorestframework 中,有一个可浏览的 api。但是我如何向用户展示他/她可以进行的所有可能的 API 调用的完整鸟瞰图?我现在一次只能看到一个,用户必须事先知道正确的 URL
IE,
http://localhost:8000/users
http://localhost:8000/books
http://localhost:8000/book/1/author
Run Code Online (Sandbox Code Playgroud)
谢谢!
答案正如克拉宁所说。用这个:
https://django-rest-swagger.readthedocs.io/en/latest/
Run Code Online (Sandbox Code Playgroud)
它对我来说开箱即用,这正是我所希望的。不过,我仍然认为,可浏览 API 一词意味着有一个目录可供 API 的使用者查看。这个应用程序是一个救星,也许它应该被包括在内!
| 归档时间: |
|
| 查看次数: |
3210 次 |
| 最近记录: |