Build a Backend REST API with Python & Django
Welcome to the course on How to Build a REST API from scratch, using Django, Django REST
Framework, Python, Vagrant, VirtualBox, Atom, and ModHeaders.
This course is made with Django and Django REST Framework.
The skills taught in this course are absolutely essential for creating successful products that
users love and can’t live without.
Facebook, Instagram, Snapchat, you name it. These apps all have their own backend REST APIs
that handle millions of call requests every day. You cannot build a successful app without a
backend REST API.
Not only is it essential to whatever app or MVP you are building -- the skills you learn in this
course will make you a kickass developer in the workplace.
If you’re a front-end developer and you take this course, you’ll be able to “speak backend” with
your colleagues and understand what’s going on “under the hood” of all your projects,
increasing your confidence and earning the respect of your peers.
If you’re a newbie developer or just starting out in your career, this course will give you a very
practical foundation to building your portfolio and increasing your earning potential.
In this course you will learn the best-practice way of building your very own REST API.
You will learn how to create a local development server and test your code each step of the way.
Whether you’re looking to gain a bit of experience with backend development, or you’re looking
to create a REST API to turn your app idea into a reality - then this course is for you.
By the end of this course, you will have built a fully functioning REST API that can handle:
Creating and updating user profiles.
Login and authentication.
Posting status updates.
Viewing status update feeds.
What you'll learn
How to create the most important part of any user application
How to confidently use some of the most in-demand full stack technologies today
How to create a local development server from scratch
How to create a brand new Django project with sqlite database
How to build your own browsable, self documenting REST API
Handle user registration, login, and status updates in your app with your very own REST API
Course content
Course Introduction
Technologies
Vagrant vs Docker
Setting up your Development Environment
Windows: Installing Git, VirtualBox, Vagrant, Atom and ModHeader
macOS: Installing Git, VirtualBox, Vagrant, Atom and ModHeader
Setting up your Project
Creating a workspace
Creating a Git project
Pushing to GitHub
Creating a Development Server
Creating a Vagrantfile
Configuring our Vagrant box
Running and connecting to our dev server
Running a Hello World script
Creating a Django App
Create Python Virtual Environment
Install Required Python Packages
Create a new Django project & app
Enable our app in the Django settings file
Test and commit our changes
Setup The Database
What are Django Models?
Create our user database model
Add a user model manager
Set our custom user model
Create migrations and sync DB
Setup Django Admin
Creating a superuser
Enable Django Admin
Test Django Admin
Introduction to API Views
What is an APIView?
Create first APIView
Configure view URL
Testing our API View
Create a Serializer
Add POST method to APIView
Test POST Function
Add PUT, PATCH and DELETE methods
Test the PUT, PATCH and DELETE methods
Introduction to Viewsets
What is a Viewset?
Create a simple Viewset
Add URL Router
Testing our Viewset
Add create, retrieve, update, partial_update and destroy functions
Test Viewset
Create Profiles API
Plan our Profiles API
Create user profile serializer
Create profiles ViewSet
Register profile Viewset with the URL router
Test creating a profile
Create permission class
Add authentication and permissions to Viewset
Test new permissions
Add search profiles feature
Test searching profiles
Create login API
Create login API viewset
Test login API
Set token header using ModHeader extension
Create profile feed API
Plan profile feed API
Add new model Item
Create and run model migration
Add profile feed model to admin
Create profile feed item serializer
Create ViewSet for our profile feed item
Test Feed API
Add permissions for feed API
Test feed API permissions
Restrict viewing status updates to logged in users only
Test new private feed
Deploying our API to a server on AWS
Introduction to deploying our app to AWS
Add key pair to AWS
Create EC2 server instance
Add deployment script and configs to our project
Deploy to server
Update allowed hosts and deploy changes