Using the browsable API to test pagination, filtering, searching, and ordering
We enabled pagination and we added filtering, searching, and ordering features to our RESTful Web Service. All of these new features have an impact on how each web page is rendered when working with the browsable API.
We can work with a web browser to easily test pagination, filtering, searching, and ordering with a few clicks or taps.
Open a web browser and go to http://localhost:8000/drones/
. Replace localhost
with the IP of the computer that is running Django's development server if you use another computer or device to run the browser. The browsable API will compose and send a GET
request to /drones/
and will display the results of its execution, that is, the headers and the JSON drones list.
We have configured pagination, and therefore, the rendered web page will include the default pagination template associated with the base pagination class we are using and will display the available page numbers in the upper...