How it works...

What we created here is an API for the bulletin board, where you can read a paginated bulletin list, create a new bulletin, and read, change, or delete a single bulletin by ID. Reading is allowed without authentication, but you have to have a user account with the appropriate permissions to add, change, or delete a bulletin. The Django REST Framework provides you with a web-based API documentation that is shown when you access the API endpoints in a browser via GET. Without logging in, the framework would display something like this:

Here's how you can approach the created API:

URL

HTTP Method

Description

/rest-api/bulletin-board/ ...

Get Django 2 Web Development Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.