Building RESTful Python Web Services
Gastón C. Hillar更新时间:2021-08-20 10:24:50
最新章节:Chapter 10 Working with Asynchronous Code Testing and Deploying an API with Tornado封面
版权页
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. Developing RESTful APIs with Django
Designing a RESTful API to interact with a simple SQLite database
Understanding the tasks performed by each HTTP method
Working with lightweight virtual environments
Setting up the virtual environment with Django REST framework
Creating the models
Managing serialization and deserialization
Writing API views
Making HTTP requests to the API
Test your knowledge
Summary
Chapter 2. Working with Class-Based Views and Hyperlinked APIs in Django
Using model serializers to eliminate duplicate code
Working with wrappers to write API views
Using the default parsing and rendering options and move beyond JSON
Browsing the API
Designing a RESTful API to interact with a complex PostgreSQL database
Understanding the tasks performed by each HTTP method
Declaring relationships with the models
Managing serialization and deserialization with relationships and hyperlinks
Creating class-based views and using generic classes
Taking advantage of generic class based views
Working with endpoints for the API
Creating and retrieving related resources
Test your knowledge
Summary
Chapter 3. Improving and Adding Authentication to an API With Django
Adding unique constraints to the models
Updating a single field for a resource with the PATCH method
Taking advantage of pagination
Customizing pagination classes
Understanding authentication permissions and throttling
Adding security-related data to the models
Creating a customized permission class for object-level permissions
Persisting the user that makes a request
Configuring permission policies
Setting a default value for a new required field in migrations
Composing requests with the necessary authentication
Browsing the API with authentication credentials
Test your knowledge
Summary
Chapter 4. Throttling Filtering Testing and Deploying an API with Django
Understanding throttling classes
Configuring throttling policies
Testing throttling policies
Understanding filtering searching and ordering classes
Configuring filtering searching and ordering for views
Testing filtering searching and ordering
Filtering searching and ordering in the Browsable API
Setting up unit tests
Writing a first round of unit tests
Running unit tests and checking testing coverage
Improving testing coverage
Understanding strategies for deployments and scalability
Test your knowledge
Summary
Chapter 5. Developing RESTful APIs with Flask
Designing a RESTful API to interact with a simple data source
Understanding the tasks performed by each HTTP method
Setting up a virtual environment with Flask and Flask-RESTful
Declaring status codes for the responses
Creating the model
Using a dictionary as a repository
Configuring output fields
Working with resourceful routing on top of Flask pluggable views
Configuring resource routing and endpoints
Making HTTP requests to the Flask API
Test your knowledge
Summary
Chapter 6. Working with Models SQLAlchemy and Hyperlinked APIs in Flask
Designing a RESTful API to interact with a PostgreSQL database
Understanding the tasks performed by each HTTP method
Installing packages to simplify our common tasks
Creating and configuring the database
Creating models with their relationships
Creating schemas to validate serialize and deserialize models
Combining blueprints with resourceful routing
Registering the blueprint and running migrations
Creating and retrieving related resources
Test your knowledge
Summary
Chapter 7. Improving and Adding Authentication to an API with Flask
Improving unique constraints in the models
Updating fields for a resource with the PATCH method
Coding a generic pagination class
Adding pagination features
Understanding the steps to add authentication and permissions
Adding a user model
Creating a schemas to validate serialize and deserialize users
Adding authentication to resources
Creating resource classes to handle users
Running migrations to generate the user table
Composing requests with the necessary authentication
Test your knowledge
Summary
Chapter 8. Testing and Deploying an API with Flask
Setting up unit tests
Writing a first round of unit tests
Running unit tests with nose2 and checking testing coverage
Improving testing coverage
Understanding strategies for deployments and scalability
Test your knowledge
Summary
Chapter 9. Developing RESTful APIs with Tornado
Designing a RESTful API to interact with slow sensors and actuators
Understanding the tasks performed by each HTTP method
Setting up a virtual environment with Tornado
Declaring status codes for the responses
Creating the classes that represent a drone
Writing request handlers
Mapping URL patterns to request handlers
Making HTTP requests to the Tornado API
Test your knowledge
Summary
Chapter 10. Working with Asynchronous Code Testing and Deploying an API with Tornado
Understanding synchronous and asynchronous execution
Refactoring code to take advantage of asynchronous decorators
Mapping URL patterns to asynchronous request handlers
Making HTTP requests to the Tornado non-blocking API
Setting up unit tests
Writing a first round of unit tests
Running unit tests with nose2 and checking testing coverage
Improving testing coverage
Other Python Web frameworks for building RESTful APIs
Test your knowledge
Summary
Chapter 11. Exercise Answers
Chapter 1 Developing RESTful APIs with Django
Chapter 2 Working with Class-Based Views and Hyperlinked APIs in Django
Chapter 3 Improving and Adding Authentication to an API With Django
Chapter 4 Throttling Filtering Testing and Deploying an API with Django
Chapter 5 Developing RESTful APIs with Flask
Chapter 6 Working with Models SQLAlchemy and Hyperlinked APIs in Flask
Chapter 7 Improving and Adding Authentication to an API with Flask
Chapter 8 Testing and Deploying an API with Flask
Chapter 9 Developing RESTful APIs with Tornado
Chapter 10 Working with Asynchronous Code Testing and Deploying an API with Tornado
更新时间:2021-08-20 10:24:50