Chapter 3.  Improving and Adding Authentication to an API With Django

In this chapter, we will improve the RESTful API that we started in the previous chapter and also add authentication related security to it. We will:

  • Add unique constraints to the models
  • Update a single field for a resource with the PATCH method
  • Take advantage of pagination
  • Customize pagination classes
  • Understand authentication, permissions and throttling
  • Add security-related data to the models
  • Create a customized permission class for object-level permissions
  • Persist the user that makes a request
  • Configure permission policies
  • Set a default value for a new required field in migrations
  • Compose requests with the necessary authentication
  • Browse the API with authentication credentials

Adding ...

Get Building RESTful Python Web Services 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.