Build a Backend REST API with Python & Django - Beginner
4.6 (2,503 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
12,929 students enrolled

Build a Backend REST API with Python & Django - Beginner

Finally create that App + fully-functioning user database in this crash course to building a REST API
4.6 (2,503 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
12,929 students enrolled
Last updated 2/2020
English
English
Current price: $119.99 Original price: $199.99 Discount: 40% off
3 days left at this price!
30-Day Money-Back Guarantee
This course includes
  • 5 hours on-demand video
  • 2 articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
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
Expand all 76 lectures 05:00:16
+ Course introduction
6 lectures 14:05

Introduction video to How to build a REST API using Python & Django REST Framework. In this video I explain what the course is about and who it is for.

Preview 01:30

In this lesson I'll break down each section of the course for a high-level overview of what you'll learn.

Preview 01:55

To build our REST API we are going to use Vagrant, VirtualBox, Atom, Python, Git, Django and Django REST Framework. In this lesson I explain how these will work together to create our REST API.

Preview 05:16

In this lesson I'll briefly go over the differences between Docker and Vagrant, and WHY we'll be using Vagrant in this course.

Preview 02:53

In this lesson I explain the teaching style and how best to take this course.

Preview 01:06

This lesson outlines the process you should use to get help from me, the instructor, in this course.

Preview 01:25
+ Setting up your development environment
2 lectures 16:55

In this lesson I show you how to install all of the applications required for this course using Windows. If you already have these tools installed or you know how to install them yourself then feel free to skip this lesson. 

Just make sure you have Vagrant, VirtualBox, Atom, Git-SCM and ModHeader (a chrome extension) installed. You can find the links to each one in the resources.

Windows: Installing Git, VirtualBox, Vagrant, Atom and ModHeader
09:22

In this lesson I show you how to install all of the applications required for this course using macOS. If you already have these tools installed or you know how to install them yourself then feel free to skip this lesson.

Just make sure you have Vagrant, VirtualBox, Atom, Git-SCM and ModHeader (a chrome extension) installed. You can find the links to each one in the resources.

macOS: Installing Git, VirtualBox, Vagrant, Atom and ModHeader
07:33
+ Setting up your project
3 lectures 20:59

In this lesson I'll explain how to create a local workspace where we will be storing all the code for our API.

Creating a workspace
05:12

In this lesson I'll show you how to create a README file for our project and initialise a new Git repository. I'll also show you how to make our first Git commit (something we'll be doing lots of throughout the course).

Update: The official GitHub Python .gitignore file is missing `.vagrant` from the list of ignored files. I've since updated this link to point to an extended version of the original Python.gitignore file which includes this extra item as well as `.sqlite3`. This makes Git ignore the temporary vagrant files and database which would typically be excluded from the git repository. (Thanks Keith for pointing this out!).

Creating a Git project
08:29
Pushing to GitHub
07:18
+ Creating a development server
4 lectures 11:19

In this lesson I'll show you how to create a Vagrantfile which we will use to describe the server we need for our back-end API.

Preview 01:47

In this lesson I'll teach you how to customise your Vagrantfile to describe a server which has all the required dependencies and settings to build and test our API.

Configuring our Vagrant box
03:35

Here I will show you how to start and connect to our development server.

IMPORTANT UPDATE

If you get the "No usable default provider could be found for your system." when running vagrant up, read this:

This is because the latest Vagrant 2.0 is not compatible with the latest VirtualBox 5.2 (as of 2017-10-25). There is an open bug on the Vagrant GitHub (https://github.com/hashicorp/vagrant/issues/9090) and hopefully Hashicorp resolve this soon.

In the mean time, you can resolve this by uninstalling VirtualBox and downloading VirtualBox 5.1 from https://www.virtualbox.org/wiki/Download_Old_Builds

If you have any issues please let me know in the Q&A and I will do my best to resolve it for you.

(Thank you James for pointing this out)


Running and connecting to our dev server
01:54

In this lesson I teach you how to run a traditional Python "Hello World" script on our newly created server.

Running a Hello World script
04:03
+ Creating a Django app
5 lectures 14:55

In this lesson, I'll show you how to create a Python Virtual Environment using virtualenvwrapper.

Create Python Virtual Environment
03:39

In this lesson I'll show you how to install the required Python packages using Python PIP.

Preview 03:10

In this lesson I'll show you have to create a new Django project and app using the Django CLI.

Create a new Django project & app
02:39

In this lesson I'll show you how to enable our newly created app in the Django settings file.

Enable our app in the Django settings file
02:14

In this lesson I'll show you how to test and commit the changes to Git.

Test and commit our changes
03:13
+ Setup the Database
5 lectures 27:39

In this lesson I'll introduce you to the concept of Django Models. 

What are Django Models?
00:38

Here I'll show you how to create a user database model which we will use to store our user profiles.

Preview 10:56

In this lesson I'll show you how to create a model manager for our user profile model. This model manager will be used to help Django work with our custom user model.

Add a user model manager
11:06

In this lesson I show you how to set the custom user model in the Django settings.

Set our custom user model
01:18
Create migrations and sync DB
03:41
+ Setup Django Admin
3 lectures 08:14

In this lesson I show you how to create a superuser.

Creating a superuser
02:33

In this lesson I show you how to enable the Django Admin.

Preview 01:15

In this lesson we test the Django admin in the browser.

Test Django Admin
04:26
+ Introduction to API Views
9 lectures 39:18

In this lesson I show you what an APIView is in the Django REST Framework.

What is an APIView?
02:47
Create first APIView
07:06
Configure view URL
05:37
Testing our API View
02:05
Create a Serializer
03:44
Add POST method to APIView
07:38
Test POST Function
02:28
Add PUT, PATCH and DELETE methods
04:24

In this lesson I show you how to test the PUT, PATCH and DELETE methods.

Notes:

When on the bottom of the hello-view page, ensure the Raw data tab is selected to see both the PUT and PATCH options.

Test the PUT, PATCH and DELETE methods
03:29
+ Introduction to Viewsets
6 lectures 24:17
What is a Viewset?
02:35
Create a simple Viewset
04:00
Testing our Viewset
02:27
Add create, retrieve, update, partial_update and destroy functions
06:42
Test Viewset
03:49
+ Create Profiles API
11 lectures 39:02
Plan our Profiles API
02:12
Create user profile serializer
08:35
UPDATE: Bug in profile serializer
01:01
Create profiles ViewSet
02:39
Register profile Viewset with the URL router
01:23
Test creating a profile
04:05
Create permission class
06:37
Test new permissions
02:27
Add search profiles feature
02:13
Test searching profiles
04:15
Requirements
  • A basic level of experience in any programming language.
  • Familiarity with simple command line tools like command prompt or terminal.
  • Access to a computer running either Windows 10 or Mac OS.
  • A passion for learning and a willingness to persevere when things get tough.
Description

Welcome to the beginner course on How to Build a REST API from scratch, using Django, Django REST Framework, Python, Vagrant, VirtualBox, Atom, and ModHeaders. You'll also learn how to deploy your dev server to AWS!

This course is made with Django 2.2 and Django REST Framework 3.9.

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 everyday. 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.

You’ll also have a solid foundation to understanding one of the most complex components in software development.

Who this course is for:
  • This course is for developers who want build a REST API either for their app, MVP or business idea.
  • This course is for frontend developers who want to learn backend.