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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.