Listing the Endpoint
Explore how to generate a reference list of API endpoints in a Django RESTful project using function-based views. Understand how to create an access point for these endpoints and test them with tools like Postman. This lesson helps you organize and verify your JWT authentication API endpoints for easier development and debugging.
We'll cover the following...
We'll cover the following...
Endpoints listing
After developing the JWT authentication API, it is best that we have a reference of its endpoints. That makes it easier to access the APIs endpoints without having to look them up in our app’s views.py file.
We can generate a list of the endpoints using a function-based view, as shown below.
In the code above:
- The
@api_viewdecorator takes a list of the HTTP methods that the view is allowed to respond