We can take advantage of the Browsable API to easily test filtering, searching, and ordering features through a web browser. Open a web browser and enter http://localhost:8000/player-scores/
. Replace localhost
with the IP of the computer that is running the Django development server if you use another computer or device to run the browser.
The Browsable API will compose and send an HTTP GET
request to /player-scores/
and will display the results of its execution; that is, the headers and the JSON player scores list. You will notice there is a new Filters
button located at the left-hand side of the OPTIONS
button.
Click on Filters
and the Browsable API will display the Filters
dialog box, with the appropriate controls for each filter that you can apply underneath Field Filters
,
and the different ordering options below Ordering
.
The following screenshot shows the Filters
dialog box:
Both the Player name
and Game name
drop-downs menu will...