
Learn to set up a Django project, create an app, define a customer model with name, age, address, and phone, migrate to sqlite, and run the admin dashboard.
Access the Django admin site, create a super user, and log in to manage users and groups; then register the customer model in admin.py to enable admin management.
Customize the admin site by creating a CustomerAdmin class that inherits from admin.ModelAdmin and displays name, age, and phone number. Register the admin to see the changes in the browser.
Install the Django rest framework with pip and add rest_framework to installed apps in settings.py. Create serializer.py to convert models to json; the next video covers the customer serializer class.
Learn to implement a customer serializer using DRF's ModelSerializer, specify the customer fields (id, name, age, address, phone number), and prepare for using the serializer in views.
Create the customers list view to handle get requests and fetch all customers from the database. Serialize them with the customer serializer and return the data as json.
Map the list view to a url by configuring customers.urls with a path to the customer list, run the server, and verify the /customers route in the browser.
Learn to collect user data via a post request, validate with a serializer, and save the object to the database, returning 201 or 400, and test with Postman.
Test the Django rest framework app with postman by sending a GET request to /customers to fetch customers, then a POST to add one, with csrf exemption and 201 created.
Implement get, update, and delete for a customer by primary key. Return 404 if not found and provide serialized json via the view and url path with the primary key.
Update a customer with the put method by extracting request data and using a serializer to update the object in the database; return the updated object as json when valid.
Delete a customer by checking the request method, calling customer.delete(), and returning an http response with status 204 no content. Verify by fetching all customers to confirm the update.
Learn to clean up code in a Django REST framework project by using REST framework status codes, the response object, and request data, replacing JSON and HTTP responses.
Import the rest framework view, build a class-based customers list with get and post methods to list and create customers, wire it in urls, and run the server.
Create a customer details class-based view to retrieve, update, and delete a customer by primary key using a serializer, handle not found with http 404, and return appropriate status codes.
Learn to use django rest framework mixins to list and create customers by combining list and create model mixins with a generic view, defining queryset and serializer.
Show how to build a customer detail view with retrieve, update, and destroy mixins in a generics view, wiring the query set and serializer class and exposing get, put, delete.
Learn to clean up Django REST framework code by using mixins to simplify views, remove unnecessary imports, and preserve create, read, update, delete operations for the customer list and details.
Django REST framework is a powerful and flexible toolkit for building HTTP enabled service APIs that expose service and data. It can be consumed by a broad range of clients including browsers, mobiles, desktop and tablets. As it is HTTP service, so it can reach a broad range of client.
Django is a back-end framework used by Python developers to develop back-end applications. Django REST framework is used build Web APIs with Django
This course will take you in a step-by-step way to build your own Web APIs with Django REST framework
By taking this course you will have the required skills that you need to build real applications using Django REST framework and to learn advanced topics about Django REST framework
Requirements for this Course:
Basic Python knowledge
Who this course is for:
The course is python developers who wants to start learning web development with Django and Django rest framework
This course is ideal for people who wish to build their own web APIs that can be connected to a Front-end application developed with a Front-end framework like React or Angular
What you’ll learn
Django project structure
Admin site in a Django project
Class based views
Generic views
Implementing CRUD operations