Today, I’m going to recommend some resources those of you who want to learn Django for free. These are the courses and videos I would pick if I were starting out as a beginner. No affiliates or sponsorships here, just my personal favourites.
The trend I noticed when researching for this post is courses are abundant for beginners but not for intermediate and advanced. That is not to say that free resources are not out there. Once you hit that intermediate level, you’ll be learning through short topic-focused videos rather than courses.
I will only be recommending resources if either:
- I have used it myself and found it valuable
- I have reviewed the source-code.
First, learn some Python.
Learn a bit of Python. You don’t have to become an expert before taking up Django but learning the basics will go a long way.
I didn’t know much Python before starting out with Django so tried to learn the two in parallel. I can say from experience that it is possible but I found that my lack of Python experience slowed me down, particularly when it came to debugging. Learning some Python first will help you understand how Django works and put you in a stronger position to debug your errors.
An underrated skill for beginner Django developers is understanding when your error is a Python problem and when it is a Django problem. Knowing the difference will make it easier for you to find the resources you need.
Socratica is hands-down the best YouTube channel for Python beginners (in my opinion). The videos are short and well explained. It’s the channel I wish I had discovered when I was a beginner. I’ve since used it to fill in gaps in my knowledge.
Code Wars is a great way for beginners to get familiar with the Python syntax. After each challenge, always look at the most popular solutions and refactor– they will teach you a lot. Your goal isn’t to work through all the levels. Instead, you’re aiming to get familiar with basic Python data structures like lists and dictionaries.
What should you learn
Aim to get familiar with these, which are all used heavily in Django (links to Socratica YouTube):
- Lists (bonus points if you can do a list comprehension)
- Data-types (integers, strings, floats, booleans etc.)
- The datetime module
- Special methods (methods that begin and end with a double underscore)
Django Resources for Absolute Beginners
A course for absolute beginners is going to cover installation of Python and Django with something called a Virtual Environment.
The course will introduce you to URLs, Models, Views and Templates and how they all link together. Expect to end up with a simple application that connects with a database and displays your data in the browser.
It doesn’t sound like much but there will be a lot to cover.
Don’t expect to understand everything straight away. Virtual environments are particularly confusing. If you’re not used to object-orientated programming, the Django way of doing things is going to take time to get used to. Even after two years, I struggle to remember all the steps and commands to get a Django project up and running, and end up referring to my notes.
This is how I got started! I was hired despite not knowing Django (my experience was in Node.js) and this was the course my line manager recommended to get up to speed quickly.
It’s a written course, no video. Every step is explained well. The tutorial covers:
- Virtual environments
- Creating a basic blog app
- Adding CSS
- Deployment to Python Anywhere
StudyBud by Dennis Ivy and Brad Traversy
This course is perfect for someone who has finished a beginner’s tutorial and wants to build confidence.
I’m a big fan of both Dennis Ivy and Brad Traversy. They’re both established YouTubers in their own right, but have teamed up to create Udemy courses.
The end-application is a Discord-like app called Study-Bud. The source-code looks surprisingly straight-forward for that kind of application, which is rather impressive.
I see that they define a Custom User Model, which is a good skill to have
There is plenty of practice of CRUD (Create, Read, Update & Delete), which is essential practice for any Django learner.
They also use Function-Based Views (FBV) throughout which makes the code easier for a beginner to follow than Class-Based Views (CBV).
I’ve classified this course as “Beginner’s Plus”. I’ve chosen this because it’s suitable for anyone who has done a beginners course. It really shows how much you can create in Django with just the basics.
How to Learn Django with React
Some of you may be looking into learning Django because you want to build a back-end for your React or Vue applications.
To do this, your Django application will be an API. A common way to do this is to install a package called Django Rest Framework (DRF).
I found another Dennis Ivy course on YouTube to recommend. This one goes through how to create a notes app with React and Django.
I haven’t done this course, so I had a review of the source code to see what level this course is aimed at. I’d classify this as an intermediate course. Even though the end application is basic, learning how to use Django REST framework; CORS headers and getting React connected with Django is certainly not for absolute beginners.
At the absolute minimum, I recommend taking a beginner’s Django course first. The best thing you can do to prepare is practice Django by making a basic notes app using templates instead of React. That way, when you take the course, you can focus on Django REST framework and linking it with the front-end.
Intermediate / Advanced Django
By this point, free courses are about to become sparse and your learning is going to shift towards blogs, documentation and topic-focused videos. My own style of learning has grown to reflect this. As I’ve built confidence with Django, I find myself turning more towards the official documentation and the source-code as a way of learning.
As I no longer have courses to recommend, I’m going to group resources by topic. These are just a few you should look into as an intermediate Django developer.
1. Class-Based Views
Views can be function-based or class-based. The vast majority of beginners’ tutorials will use function-based views because they are easy to read and understand, even though they require more code.
Class-based views offer a way of writing views with less code. While they take time to get familiar with, they offer brevity which in time will result in cleaner code.
I recommend this YouTube playlist by Very Academy to get familiar.
Signals are used when you want part of your application to be notified when something has happened. A common example is to get profiles created for users automatically when a new user is created. Vitor Freitas’s tutorial will help you get started.
3. REST APIs with Authentication
One of the biggest challenges of using Django with React is handling authentication when front and back-ends live on separate servers. Dennis Ivy’s Django + React course doesn’t handle user authentication, but he does have a separate, more advanced video that implements JWT and refresh tokens. If you’re looking for some background on the topic, then try William Vincent’s DjangoCon talk, which provides an overview of 4 authentication methods:
4. Social Authentication
Another good skill to learn is how to authenticate users using their social media logins rather than supplying a username and password.
For this, William Vincent has a boilerplate public on Github: https://github.com/wsvincent/drfx/. Sometimes it’s easier to skip the tutorial and go straight to the code.
5. Advanced Python
As you gain experience as a developer and your projects get more complex, success depends less on what you’re building but how.
Right now, I’m a big fan of Arjan Codes. A few months ago, I was assigned to build a new tool at work with just one other developer. I was given a lot of freedom to write the code how I wanted, so it was important that I wrote clean code.
Complex projects involving data from multiple sources involve a lot of Python. Arjan’s videos have helped me make more use of Object Orientated Programming (OOP) and identify code smells.
This video on common Python code smells is a great way to learn a few Python best practices:
6. Everything Else (Awesome Django)
Finally, I must recommend Awesome Django which is a curated list of Django resources. It provides lists of useful Django packages alongside a long list of additional resources.
It is definitely possible to learn Django without paying for anything. Django Girls is a well-explained tutorial to get you started. Dennis Ivy and Brad Traversy’s Study Bud course is great for new Django developers to practice the basics and build confidence.
If you’re looking to use Django with React from an early stage, Dennis Ivy’s free course is a great way to get started, though you’ll need to refer to a separate video to cover the more advanced topic of handling authentication with APIs.
Once you get to intermediate/advanced level Django, free courses become scarce but there are still plenty of videos and blogs. Very Academy, Simple is Better Than Complex and Awesome Django are just three of my personal favourites.
CTRL + Z Blog
I started the CTRL + Z blog to help aspiring and junior developers learn Django faster. I combine my experience as a Django developer with the vivid memory of what it’s like to be a beginner, to deliver clear and concise tutorials.
Follow me on Twitter to be the first to know about new articles.