更新时间:2021-06-30 19:31:26
coverpage
Title Page
www.PacktPub.com
Why subscribe?
PacktPub.com
About the Author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Installing the Required Software and Tools
Creating a virtual environment with Python 3.x and PEP 405
Understanding the directory structure for a virtual environment
Activating the virtual environment
Deactivating the virtual environment
Installing Django and Django REST frameworks in an isolated environment
Creating an app with Django
Understanding Django folders files and configurations
Installing tools
Installing Curl
Installing HTTPie
Installing the Postman REST client
Installing Stoplight
Installing iCurlHTTP
Test your knowledge
Summary
Working with Models Migrations Serialization and Deserialization
Defining the requirements for our first RESTful Web Service
Creating our first model
Running our initial migration
Understanding migrations
Analyzing the database
Understanding the table generated by Django
Controlling serialization and deserialization
Working with the Django shell and diving deeply into serialization and deserialization
Creating API Views
Creating Django views combined with serializer classes
Understanding CRUD operations with Django views and the request methods
Routing URLs to Django views and functions
Launching Django's development server
Making HTTP GET requests that target a collection of instances
Making HTTP GET requests that target a single instance
Making HTTP POST requests
Making HTTP PUT requests
Making HTTP DELETE requests
Making HTTP GET requests with Postman
Making HTTP POST requests with Postman
Using Generalized Behavior from the APIView Class
Taking advantage of model serializers
Understanding accepted and returned content types
Making unsupported HTTP OPTIONS requests with command-line tools
Understanding decorators that work as wrappers
Using decorators to enable different parsers and renderers
Taking advantage of content negotiation classes
Making supported HTTP OPTIONS requests with command-line tools
Working with different content types
Sending HTTP requests with unsupported HTTP verbs
Understanding and Customizing the Browsable API Feature
Understanding the possibility of rendering text/HTML content
Using a web browser to work with our web service
Making HTTP GET requests with the browsable API
Making HTTP POST requests with the browsable API
Making HTTP PUT requests with the browsable API
Making HTTP OPTIONS requests with the browsable API
Making HTTP DELETE requests with the browsable API
Working with Advanced Relationships and Serialization
Defining the requirements for a complex RESTful Web Service
Creating a new app with Django
Configuring a new web service
Defining many-to-one relationships with models.ForeignKey
Installing PostgreSQL
Running migrations that generate relationships
Configuring serialization and deserialization with relationships
Defining hyperlinks with serializers.HyperlinkedModelSerializer
Working with class-based views
Taking advantage of generic classes and viewsets
Generalizing and mixing behavior
Working with routing and endpoints
Making requests that interact with resources that have relationships
Using Constraints Filtering Searching Ordering and Pagination
Browsing the API with resources and relationships
Defining unique constraints