
Explore building and exposing a web API with Django Rest Framework on Heroku, handling get, post, patch, and delete operations, using JSON data and token-based security, and deploying to Heroku.
Set up a Windows development environment for Django, verify Python 3 installation, create and activate a virtual environment, install Django, and run the development server with migrations and a superuser.
Prepare a Django project by creating and activating a virtual environment, installing Django and Django REST framework, then creating an app, applying migrations, and starting the server.
Create complex models with one-to-many relationships, including documents and document types, register them in admin, migrate databases, and expose via routers, views, and serializers to power a Django REST API.
Refine the data models to establish robust relationships among customers, documents, professions, and data sheets, enable cascade delete, and prepare migrations for the api on Heroku.
Set up the Django rest framework, enable the browsable API, and create the first API endpoint by defining a customer serializer, a viewset, and routers.
Learn to consume a Django Rest Framework API with Postman, testing endpoints via GET, POST, PUT, and DELETE, and explore nested relationships between customers, professions, and data sheets.
Finish wiring the endpoints for the sheet and document by configuring routers, viewsets, and serializers, and validate get, post, and delete operations to ensure working API endpoints.
Override the get_queryset method in Django Rest Framework views to filter active customers using a boolean active field, configuring the base name and returning a refined queryset for the API.
Override the list method in Django Rest Framework to customize the queryset and response, replacing the default get_queryset flow with your own serializer and logic.
Override the default get behavior for a specific resource with a custom retrieve method in Django REST framework, obtaining the object via self.get_object or primary key, then serialize and respond.
Learn how to override the post behavior in Django Rest Framework to create a new customer, fetch related profession and data sheet data, and return a clear serializer response.
Override the PUT method in Django REST Framework to customize resource updates, including fetching the object, applying field updates with validation, and managing related professions.
Override the destroy method in your DRF viewset to customize delete behavior, returning a serialized response or message instead of the default status.
Learn to create custom actions in Django Rest Framework on Heroku with the @action decorator, enabling detail and list endpoints to activate or deactivate customers.
Implement query parameter handling in Django Rest Framework to filter API responses by active and ID, reading and applying filters before serialization.
Learn to filter API data by address using query params in Django Rest Framework on Heroku, replacing id filters with contains-based address queries.
Enable the DjangoFilterBackend in Django Rest Framework projects, globally via settings or per view. Declare filterable fields (e.g., name) and use query parameters like name contains Mary to filter results.
Enable search on your Django Rest Framework API by adding a search backend to your viewset, defining search fields like name and address, and using query parameters.
Learn to change the default lookup field in Django Rest Framework from id to a unique field such as name or full name, with lookup_field, uniqueness validation, and migrations.
Discover how to enrich Django Rest Framework serializers by defining model properties and including them in the serializer output to tailor rich, conditionally shown data for your API.
Learn to implement serializer method fields in Django Rest Framework using get_<field> methods to compute dynamic data from the model, such as a customer's professions count.
Learn to use the primary key related field in Django Rest Framework to return primary keys for related objects, with examples of serializing tracks and handling many-to-many relations.
Explore nested serializers in Django Rest Framework to embed related objects, like including full data sheets within customers, while balancing payload size and performance for multi-level relationships.
Enable token-based authentication in a Django Rest Framework API, log and guard endpoints, issue and test access tokens for users, and verify access with token-driven requests.
Enable and manage access to your Django Rest Framework API by configuring global and per-endpoint permission classes, distinguishing authentication from authorization, and using IsAuthenticated, AllowAny, and ReadOnly settings.
Explore how Django REST framework's DjangoModelPermissions and DjangoModelPermissionsOrAnonReadOnly control access to models, requiring authentication for writes, demonstrating 403 responses and default add, change, delete, and view permissions.
Learn to manage many-to-many relationships in Django Rest Framework by customizing serializer create methods, using read_only fields, and creating and linking professions to customers in a single api call.
Learn to handle foreign keys in Django REST Framework on Heroku by configuring the document serializer, removing the id field, creating the customer first, and linking documents to that customer.
Finish deploying your django rest framework app to heroku, configure domain and ssl, run migrations, create a superuser, and test the api with postman.
Join our comprehensive, hands-on course for a thorough exploration of the Django Rest Framework, featuring practical examples. This course is tailored for those with knowledge in Python 3+, Django 2+, Django Rest Framework 3, and covers tools like Postman and Heroku.
Course Outline:
1. **Introduction**
2. **Environment Setup**
3. **Building the Core Application (Customer Base App)**
- Creating a full-fledged project with database relationships, image upload, and in-depth backend insights.
4. **Django Rest Framework Integration**
5. **Developing a Customer API Endpoint**
- Implementation and testing using Google Chrome and Postman.
6. **Endpoint Creation for All Entities**
7. **Customizing `get_queryset` Method**
- Enhancing Customer data retrieval with filters.
8. **Modifying Default HTTP Verb Behaviors**
- GET, POST, PUT, PATCH, DELETE.
9. **Implementing Custom Actions and Query Strings**
10. **Advanced Queryset Filtering**
- Utilizing DjangoFilter backend.
11. **Enabling API Search and Custom Lookup Fields**
12. **Enhancing API Security**
- Token-based authentication and custom permissions.
13. **Understanding Nested Relationships**
- OneToOne, ForeignKey, ManyToMany.
14. **Exploring Serializer Types**
- Nested serializers and function fields.
15. **Diving into ViewSets Varieties**
16. **Implementing API Pagination**
17. **Deployment and Version Updates on Heroku**
Throughout the course, you'll build a 'Customer Base' project, learning to manage database relationships, understand API security, and deploy your application on Heroku. We'll also cover version updates post-deployment, ensuring you have the skills to maintain and improve your project.