
Build a complete e-commerce REST API with Django and Django Rest Framework from scratch, covering products, authentication with JWT, reviews, orders, Stripe payments, S3 uploads, and deployment to AWS.
Explore how an API, especially a REST API, bridges client and server to exchange data via HTTP methods like get, post, put, and delete, with JSON.
Discover how Django and Django REST framework enable fast, scalable web apps and REST APIs, building a complete ecommerce API with authentication, Stripe payments, and AWS deployment.
Install the essential tools for this course: Visual Studio Code, Postgres for database, Postman for API testing, and optional git bash, with platform-specific download guidance for Mac and Windows.
Access the official git repo for the e-shop course on GitHub, with 11 section branches to fetch source code, including upload image, authentication, reviews, and stripe integration; bookmark the repo.
Set up a dedicated virtual environment, install Django, create a new e-shop Django project, and review the folder structure including manage.py, __init__.py, settings.py, and urls.py.
Install and configure Django rest framework, add it to installed apps, set up django dot env for secret key and debug in settings.py, then run the server.
connect your django app to postgres by installing psycopg2, setting environment variables for LDFLAGS and CPPFLAGS on mac, and configuring django settings to connect via pgadmin on localhost:5432.
Create a Django product app and define its product model with fields for name, description, price, brand, category, ratings, stock, and a user foreign key, plus migrations and admin configuration.
Register the product app in settings, run makemigrations and migrate, create a super user, and manage the first product in the Django admin panel, displaying it by name.
Master an endpoint that retrieves all products from the database using Django rest framework. Create a product serializer and wire up URLs for API access.
Create an endpoint to fetch a single product's details by its id with a Django REST Framework API view, using get_object_or_404 and a serializer, and expose it at /api/products/{id}.
Implement search filters and pagination for the ecommerce API using Django-filter, adding a ProductFilter with category and brand fields, wiring it into views and serializer queries, then test with Postman.
Add product search with a keyword field and a character filter on the product name; extend to min and max price using gt and LTE.
Learn to implement custom 404 and 500 error handlers in a Django project, returning JSON responses with clear messages, and test them by disabling debug and configuring allowed hosts.
Implement a custom exception handler in Django REST Framework to format errors with a structured payload (status code, message, details) and wire it into settings to override default error handling.
Create an AWS S3 bucket for image storage, set a bucket policy, and create an IAM user with S3 full access, generating access keys for Django integration.
Install and configure Django storages to use AWS S3 for media files, set API keys and bucket region in env files, and prepare image upload to S3.
Create a product images model linked to products, upload multiple images to an AWS S3 bucket via a Django REST Framework endpoint, and serialize the results for database storage.
Add a read-only images field with many=true to the product serializer to display images within each product in the Django REST Framework API, using Postman to verify.
Create a new product through a Django REST Framework endpoint, saving data via the request, serializer, and product model to the database.
Add validation and error handling to the new product endpoint by using extra keyword arguments in the serializer to enforce required fields and report errors with serializer.is_valid.
Update product details via a put endpoint in Django REST framework, validating by id and updating name, description, price, category, brand, ratings, and stock, returning the updated product at /products/{id}/update.
Learn how to automatically delete product images from an S3 bucket using Django signals and a post_delete receiver when removing a product.
implement authentication with the simple jwt package in django rest framework, configuring access and refresh tokens, token lifetimes, blacklist after rotation, and bearer token authentication for protected endpoints.
Create sign up and user serializers in the account app, defining first name, last name, email, and password with validations and a minimum length of six.
Register users by posting to a Django REST framework endpoint, validate input with a signup serializer, check for emails, hash the password with make_password, and return success or error responses.
Authenticate users with simple jwt by posting username and password to the /api/token endpoint to obtain access and refresh tokens for protected routes.
Create a protected endpoint to fetch the details of the currently logged-in user using is_authenticated and request.user, returning serialized user data.
Learn how to save the current user in a product during creation by protecting routes with is_authenticated and request.user, and enforce a 403 check for unauthorized updates.
Create a protected endpoint to update user profiles with Django REST Framework, updating first name, last name, username, email, and optionally the password.
Create a review model and serializer in the ecommerce Django app, linking reviews to products and users with rating and comment fields, and generate migrations.
Develop and expose a Django REST Framework endpoint to create or update product reviews, enforce rating 1–5, authenticate users, and recalculate the product's average rating.
Learn to display all product reviews in the API response by adding a serializer method field, implementing get_reviews to fetch product.reviews.all and serialize them with a review serializer.
Create a delete review endpoint for a product, removing the user's review and handling not found errors. After deletion, recalculate and save the product's average rating, guarding against null values.
Configure Django to send password reset emails using Mailtrap, wiring SMTP settings through environment variables and choosing the SMTP backend or console backend for testing.
Implement a forgot password endpoint in Django REST framework, generate a 40-char token with a 30-minute expiry, save it to the user profile, and email a reset link.
Build a reset password endpoint with a token, validate and hash the new password (and confirm it), update the user profile, and enforce token expiry handling.
Are you ready to take your Django programming skills to the next level? Look no further than this comprehensive course on building REST APIs with Django & Django REST Framework. With step-by-step instructions, you'll learn how to design, build, and deploy RESTful APIs that can be integrated into any application or service.
From authentication and authorization to serialization and validation, you'll gain a deep understanding of the key concepts that you need to succeed in modern web development with Django & Django REST Framework. You'll learn how to create APIs that are efficient, scalable, and secure, using the latest tools and techniques. Whether you're building a web application, mobile app, or any other type of software, REST APIs are a critical component of modern programming.
In this comprehensive Django course, you'll learn how to build an e-commerce REST API using Django REST Framework. Whether you're a beginner or a seasoned developer, you'll discover the key concepts, techniques, and tools to create a robust and scalable e-commerce API in Django.
Django REST framework is a powerful and flexible framework for building Web APIs. It is one of the most popular frameworks from Django, it is beginner-friendly and provides a lot of features. It has made life a lot easier with features like Serialization, Filtration, Pagination, Exception Handling, Validations, Authentication, and much more.
=== Super Friendly Support ===
If you ever get stuck in any problem, I'm here to unstuck you. I always respond as fast as I can. Because I know there’s nothing worse than getting stuck into problems, especially programming problems. So, I am always here to support you.
Below are some features that will add to this production-ready app:
Understanding Folder Structure
Connecting to Postgres Database
Making Migrations
Filters, Search & Pagination
Error/Exception Handling
Upload Product Images on AWS S3
Manage Product
Authentication & Authorization
Handle Product Reviews
Forget & Reset Password
Manage Order Resource
Integrate Stripe for Payments
Deploy API on AWS Elastic Beanstalk
You can watch the complete DEMO of this API in the course content. If you are ready to build Production-Ready, Scalable REST API in Django & Django REST Framework then I will see you in the course.