Skip to Content
Building RESTful Python Web Services
book

Building RESTful Python Web Services

by Gastón C. Hillar
October 2016
Intermediate to advanced
418 pages
9h 52m
English
Packt Publishing
Content preview from Building RESTful Python Web Services

Chapter 7.  Improving and Adding Authentication to an API with Flask

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

  • Improve unique constraints in the models
  • Update fields for a resource with the PATCH method
  • Code a generic pagination class
  • Add pagination features to the API
  • Understand the steps to add authentication and permissions
  • Add a user model
  • Create a schema to validate, serialize and deserialize users
  • Add authentication to resources
  • Create resource classes to handle users
  • Run migrations to generate the user table
  • Compose requests with the necessary authentication

Improving unique constraints in the models

When we created the Category model, we ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RESTful Python Web Services - Second Edition

Hands-On RESTful Python Web Services - Second Edition

Gastón C. Hillar

Publisher Resources

ISBN: 9781786462251Supplemental Content