
Build a Python REST API with the Django REST framework by learning to tackle roadblocks, rely on Google searches and questions, and commit to delivering real results.
Explore api basics, core concepts, and how we’ll use an api, as this welcome overview sets a reference point before diving into code in the next section.
Explore how APIs enable communication between software components, including internal and external APIs and rest concepts, with concrete examples from camera access, Facebook login, Stripe, and MailChimp.
Explore how REST APIs enable uniform access to web resources via HTTP methods (GET, POST, PUT, DELETE) and JSON, supporting CRUD-driven, scalable development across server and client.
Before building a pure Django API with the Django Rest Framework, choose one of two recommended courses: the Django 1.11 course or the e-commerce course to solidify your Django experience.
Learn to build a rest API with pure Django to compare with the Django rest framework, starting from a fresh virtual environment and project.
Create an updates app to handle crud operations for posts with content and optional image, linked to the user via a foreign key, then migrate and register the admin.
Learn how to build a retrieve view that returns json data using Django's json response, converting Python dictionaries to json, and align with REST API standards.
Discover Django's shortcut to return json data via HttpResponse with content type application/json, avoiding older json.dumps usage from Python's json library, and note how a simple get request retrieves data.
Convert a Django view into a class-based json response by building a json response mixin, defining get data, and rendering with json response for a reusable rest endpoint.
learn how to serialize data in django rest framework by converting models and query sets to json, using serializers to specify fields, and handling single objects versus lists.
Build serialized data in a Django REST API by wiring a model manager and a serialize method to produce JSON for instances and query sets using json loads and dumps.
Use the values method on a queryset to serialize data into dictionaries with user IDs and images in Django. Compare this approach to manual dictionary construction for image fields.
Create a practical Django rest api module by building a dedicated api app with class-based views to handle get, post, put, and delete as json.
Build list and detail views for an update model with Django REST framework, serialize data to JSON, and configure URL routing for testing APIs.
Learn to test a Django Rest Framework API from outside Django using Python requests, fetch endpoints, parse JSON, handle status codes, and iterate over list data with CRUD basics.
Experiment with creating and updating a rest api endpoint, sending post requests, and handling status codes like 200 and 403, while applying a csrf exempt mixin for testing.
Create a reusable mixin to standardize http status codes in Django Rest Framework responses, using json content-type and statuses like 200, 400, and 403 for get, post, and delete operations.
Validate data including content or image in a Django REST API with a model form, is_valid, save, and serialize the result.
Implement update and delete endpoints for a single object in Django Rest Framework, using get_object or queryset checks, handling not found errors, and parsing json from the request body.
Validate json data for each request with a utility that attempts to load json and returns a boolean, issuing a 400 bad request on invalid data.
Update and delete in a Django Rest Framework API rely on pre-validation of JSON data, serializers and model forms to merge past and new data into the instance.
Implement a single endpoint for create, read, update, and delete in a Django REST Framework project, compare pure Django API with the Django REST Framework, and explore authentication and permissions.
Discover how the django rest framework connects a django backend to web, iOS, Android, and TV front ends using a comprehensive api, with emphasis on django 1.11’s long-term support.
Install and configure the Django rest framework in your project, add it to installed apps, run migrations, and create a new app model to build a REST API.
Build a new status app for a Django Rest Framework project, modeling a user post with a foreign key, content and image fields, and timestamps, plus admin registration and migrations.
Create and validate a Django model form in the admin to enforce that either content or image is present and the user field, with a 240-character content limit.
Turn your Django models into JSON with a serializer in the Django REST framework, and learn to validate and render data for clients.
Learn to create, update, and delete objects using Django REST framework serializers, validate data with is_valid, and work with instances, IDs, and serialized representations.
Validate data in Django Rest Framework by applying field-level and serializer-level validation on model serializers, using ValidationError, and exploring custom serializers and common fields.
Explore building a Django rest framework API endpoints overview, transitioning from separate CRUD views to a single versatile endpoint using a serializer and built-in DRF methods.
Create a status list and search API view with Django REST framework. Use a generic list API view, a status serializer, and filter by query via content contains, returning JSON.
Create an API view by duplicating the status API view to a status create API view, wiring the queryset and override perform_create to set user to request.user on save.
Build a status detail using a Django rest framework retrieve API view, adjust the look up field to id or slug, and use keyword arguments for object retrieval.
Explore implementing update and delete API views in Django Rest Framework by converting detail views to generics and planning a single all-in-one view.
Explore how to power http methods with Django rest framework mixins, building list, create, update, and destroy capabilities in api views using create, update, and destroy model mixins.
Explore building a single Django REST Framework endpoint that handles CRUDL for a status model, serving list or single object responses and supporting get, post, put, patch, and delete.
Test a local Django Rest Framework endpoint with a third-party script using Python requests. Learn to perform get, post, patch, and delete calls and handle JSON data and headers.
Learn to upload and handle images with the Django REST framework by configuring media routes, managing image paths, testing uploads locally or with a storage service like S3.
Implement two views for CRUDL in a Django rest framework API, converting to a detail and list view, handling update, delete, and image data with serializers.
Authenticate users and enforce permissions in a Django REST framework api using session authentication, is_authenticated checks, and read_only_fields to ensure secure access and a read-only user field.
Configure global defaults for authentication and permissions by adding a rest_framework configuration in a central settings module, then apply session and basic authentication to verify endpoints.
Test a Django Rest Framework API with Python requests, sending GET and POST payloads and examining missing authentication credentials, and explore JSON Web Token authentication and its relation to OAuth.
Install and configure jwt authentication in Django rest framework, create an obtain token endpoint, and test token refresh and usage with python requests and authorization headers.
Explore how to use a JWT authorization header with a prefix, manage token expiration in seven days, and handle request headers for post and put operations.
Customize the jwt response payload in a django rest framework setup, create an accounts app to manage tokens, and implement expiration handling for authentication results.
Learn to build a custom authentication view in Django Rest Framework, enabling token creation, flexible login with username or email, and tailored response payloads.
Learn to implement a register API view in Django Rest Framework, test token authentication, and shift from manual user creation to serializer-driven registration.
learn how to build a user registration serializer with the django rest framework, implementing write-only passwords, custom validation, and secure user creation with set_password.
Learn how the serializer method field runs a get_token method on the serializer to return a token and its payload, with optional get_expires logic.
Learn to pass the actual request to a serializer using get_serializer_context in Django Rest Framework, access request data and authentication details, and prepare token responses and permissions.
Implement custom permissions in Django Rest Framework, handling authenticated and anonymous access, plus view and object level checks, with customizable messages.
Implement the owner or read-only permission to let logged-in users update their own status posts using JWT authentication, and test endpoints with put and post.
Learn to implement nested serializers in a Django REST Framework API, enabling read-only user details via a public user serializer, and using serializer method fields for richer URIs.
Master nested serialization in Django Rest Framework by building a user detail API view that returns related statuses via a nested serializer and a serializer method field, with queryset filtering.
Master nested serializers in a Django Rest Framework API by wiring a user serializer to inline recent statuses and status lists, with permissions, querysets, and detail versus list views.
Explore how to implement and customize pagination in a list api view using the rest framework. Apply a custom pagination class and global defaults for efficient data loading.
This lecture explains how to implement search and ordering in a Django REST framework API using filter back ends, default parameters, and search fields like user__username and content.
Learn to generate fully qualified URLs with DRF's API reverse, pass request context to serializers, and wire namespaces, view names, and keyword args for user and status endpoints.
Explore serializer related fields in the Django rest framework, including primary key related fields, slug related fields, and hyperlinked related fields, with source and read only and reverse relationship concepts.
Learn how to automate Django rest framework tests with unit tests using python manage.py test, create users, and verify status content in an isolated fake database.
Test a Django rest framework user API with register and login endpoints, using reverse URLs and API client to validate creation, tokens, and error responses.
Learn to implement and test a Django Rest Framework API, including status endpoints, token authentication, and full CRUD operations with robust test cases and assertions.
Test a django rest framework image upload using a temporary pillow image, validating create with and without token, multipart data, and media cleanup for reliable api behavior.
Explore throttling in the Django Rest Framework, learn why view sets are optional, review parsers and generic views, and plan how to build front-end clients to consume the API.
Take the next step by exploring how a rest api service lets you control and pass data, and discover how to integrate it with React using our YouTube tutorials.
REST APIs Power the Internet
How does Apple Maps have Yelp listings?
How does Tinder get Facebook user profiles?
How does Amazon Alexa know the latest news?
These questions get to the core of how powerful REST APIs can be: it allows for websites to communicate with each other without any human interaction.
Building a REST API isn't just about connecting with third party services, it's also about:
This course will teach you step-by-step exactly how to build a REST API
We'll cover the concepts first, then we'll go into build a PURE DJANGO REST API, then we'll use the Django REST Framework to build a REST API.