Getting Started with Django: A Practical Intro Course

Course Summary

Django is one of the most popular web frameworks for coding in Python. It includes libraries for: templating HTML content, URL routing, views, a robust Object Relational Model (ORM) for mapping classes to database queries, HTML form management, a built-in administrative tool, and much more. This course teaches you how to build your first Django project and guides you through the key parts of the library.

What students are saying

In these first 13 minutes I learned so many techniques and best practices.

Quite a few times I found myself cursing that it had taken me weeks to learn what Michael was demonstrating in meer minutes.

The beauty of the course however lies in the fact that you're not spoon fed everything. You're expected to have prior knowledge of concepts such as Python Classes, data structures and so on.
-- Julian Sequeira (from @pybites)

Source code and course GitHub repository

github.com/talkpython/getting-started-with-django-course

Application Development Approach

This course is constructed around a project called Alexandria, a virtual library. Each chapter covers a new Django concept, but it also adds a feature to the application. As you proceed through the course you will not only learn more about Django but also be building features and tests as you would for developing real world software.

What will you learn in this course?

While building our Django app, you will:

  • Set up a new project
  • Understand Django's project structure
  • How to use the Django database ORM, including: common fields, writing queries, Foreign Keys and related objects, and light-weight migrations
  • Create function-based views: the code that responds to the browser
  • Turn data to HTML with HTML Templates
  • User management: Creating users, managing logins, password resets, and the
  • Built-in admin for users
  • Data management: Loading / saving database fixtures
  • Mapping URLs and URL patters to function-based views with URL routing
  • HTML Forms: GET vs POST, submitting data to server, and using the forms library
  • Considerations when deploying Django
  • Third party libraries: A quick tour of popular libraries and how to install them
  • View the full course outline.

Who is this course for?

This course is for anyone who wants to learn how to build web applications using Django.

An intermediate understanding of the Python language is recommended, students should be comfortable with functions, variables, data types such as dictionaries.

Additionally, familiarity with basic web concepts is of value including common HTML tags, basic CSS style sheets, and HTTP Verbs such as GET and POST.

Follow along with subtitles and transcripts

Each course comes with subtitles and full transcripts. The transcripts are available as a separate searchable page for each lecture. They also are available in course-wide search results to help you find just the right lecture.

Each course has subtitles available in the video player.

Who am I? Why should you take my course?

Who is Christopher Trudeau?

My name is Christopher and I'm happy to be delivering this Django course for you. I've been writing Django web applications for over a decade at a variety of companies both small and large. I am a consultant who provides organizations advice on both their technical stack and software development processes.

I've taught thousands of students in person and virtually on a variety of topics, including Agile methodologies, Testing, Requirements management, and DevOps. My Python screencasts cover Django, PyGame, SQLAlchemy, Data structures, Unicode, cryptography, and more.

You may also know me from The Real Python Podcast, where twice a month I cover recent articles and news items in the Python world, or from my book Django In Action, available at Manning.com.

Free office hours keep you from getting stuck

One of the challenges of self-paced online learning is getting stuck. It can be hard to get the help you need to get unstuck.

That's why at Talk Python Training, we offer live, online office hours. You drop in and join a group of fellow students to chat about your course progress and see solutions via screen sharing.

Just visit your account page to see the upcoming office hour schedule.

Is this course based on Python 3 or Python 2?

This course is based upon Python 3. Python 2 is officially unsupported as of January 1st, 2020 and we believe that it would be ill-advised to teach or learn Python 2. This course is, and has always been, built around Python 3.

Learn Django Today

Django is a deep framework that has everything you need to build web applications. Add web capabilities to your Python knowledge today!

Course Outline: Chapters and Lectures

Introducing the Django Web Framework
16:53
Chapter concepts
1:17
Your first Django app
1:49
Why choose Django?
1:06
Who uses Django?
0:37
Student prerequisites
0:43
Minimum library versions
0:24
Visualizing how Django works
2:08
Mapping URLs to code
2:32
HTML template engine
1:30
Database models
1:02
Built-in user management
0:31
Django Admin
0:48
Django's pluggable architecture
0:58
Topics covered throughout this course
1:28
Your First Django App
25:08
Intro
1:33
Installing django
3:34
Your first django app
1:32
Apps vs projects
3:44
Creating a Django app
1:17
Add a new app to Django
1:32
Creating a view method
1:55
Connecting a URL to a view
2:31
Why test Django views?
1:28
Writing a 'say hello' view test
5:09
Chapter review
0:53
HTML Templates
41:39
Chapter concepts
3:18
New app for templates
2:34
Your first Django template
3:46
Rendering the template
1:54
Registering new 'home' URLs
2:00
Test the template in the browser
1:04
Common template tags
2:47
Common template filters
0:55
Django output types
1:19
Configuring static content
1:49
Favicons and static redirects
2:46
Introducing layout pages
2:20
Bootstrap bootcamp
0:51
Creating the shared layout page
4:51
Creating the About page
1:15
Viewing our shiny new About page
1:31
Building the home page with layout
2:32
Unit testing HTML templates
1:45
Chapter review
2:22
Django ORM and Databases
39:35
Introducing Django's ORM
5:14
Creating the Author model
3:14
Creating the Book model
2:25
Automatic `created` and `updated` dates on the model
0:38
Initializing the database
1:20
The Django REPL
2:28
Explore the query manager in the Django REPL
0:56
Using '.objects.get()' for access by key
0:44
More advanced queries with '.filter()'
1:55
Improved debug info for books
1:04
Comparison queries such as greater than
0:54
Exploring the resulting database
2:12
Introducing data loading fixtures
0:54
Exporting data with 'dumpdata'
2:12
Associating data fixtures with a Django app
1:13
Returning database results in a view
2:14
Different database back-ends: Sqlite, Postgres, etc
1:36
Testing Django ORM code
0:51
Test setup
1:01
Your first Django ORM test
0:37
Calling a view in test with the test client
1:07
Running the 'stringify' test
1:39
Running all tests
0:49
There's more to the ORM
0:45
Chapter review
1:33
Django Admin
34:08
Admin intro
2:16
Django users
2:13
Logging into the Admin
1:23
Modifying users in the Admin
2:09
Creating Admin views for your models
3:02
Customizing the display fields in the Admin
1:11
Add computed fields to 'ModelAdmin' classes
1:45
Adding and deleting Books in the Admin
1:17
Filtering records in the Admin
1:09
Improving the Author display in filter list
0:37
Model object metadata
3:09
Referencing Admin URLs
1:16
Improving the Author model's list display
5:03
Testing with the Admin
1:01
Setting up an Admin model test
2:22
Writing an Admin model test
2:05
There is more depth in the Admin
2:10
Users and Account Management
56:54
Chapter concepts
1:50
Create a user via the Admin
2:02
Authentication vs authorization
1:11
People app: an app with users
2:22
Authenticated profile details view
3:09
Adding the profile HTML template
0:58
Register profile URL patterns
1:22
Viewing the profile pages
1:10
Verifying login required checks
1:01
Authorization templates
1:53
Setting update Django contrib auth
1:06
Login template
1:28
Where to go after login
0:49
Creating a nav bar
3:33
Testing login
1:00
Changing passwords
2:53
Password changed success
1:14
Django and email
3:05
Reset email with console output config
2:06
Email contents for reset email
1:41
Password reset done page
0:46
Reset confirm HTML
1:17
Reset success HTML
0:29
Add forgot password to login
1:37
Branded error screens
2:52
Customizing the user model
3:30
Add profile to user object
1:49
Registering a user-created signal callback
2:29
Adding the user profile to Django admin
4:21
Demo: user testing
0:46
Chapter review
1:05
Posting Data
37:34
Post introduction
1:35
Field validators and model constraints
1:08
Adding a 'ReviewModel' with field validation
1:14
Adding constraints to the 'ReviewModel'
0:54
Writing an Admin class for the 'ReviewModel'
1:31
Link to the user's reviews in the Django Admin
2:42
Configuring PyCharm with Django's dev server
1:55
Demo: 'ReviewModel' in Django Admin
1:12
Add a view for a book
2:44
HTTP GET and POST methods
2:42
Building a 'ModelForm' based on the 'ReviewModel'
1:40
Writing a view that fills review forms
7:14
Registering named URLs
0:46
Creating the review book template
3:16
Demo: Writing a review
0:21
Replacing hard-coded URLs with named ones
1:24
Testing Django forms
3:43
Reviewing the chapter
1:33
Receiving Uploads in Django
28:41
Intro to web uploads
0:47
Uploading images using forms
1:13
Adding an 'ImageField' and configuring media files
2:08
Making the development server host media files
1:29
Creating an upload directory and migrating DB changes
1:00
Using the Django Admin to upload an author's picture
1:19
Server-side filenames
1:10
Writing an upload view
5:05
Url configuration for the upload view
0:56
Upload view template
3:13
Demo: Image upload form
0:39
The trouble with user uploads
3:48
Testing an upload view
4:51
Chapter review
1:03
Custom Django Commands
16:48
Intro to commands
0:31
Management commands provided by Django
1:31
Structure of a management command
1:09
Your first management command
3:45
Running the 'authors' command
1:29
Writing management commands with arguments
3:59
Running the 'book' command
0:48
Testing management commands
2:40
Chapter review
0:56
DB Migrations
13:13
Intro to migrations
2:54
An initial migration script
1:50
Migration and the database
0:55
Adding a column to the 'Song' model
1:23
A second migration script
1:00
Migrating to a specific point including backwards
0:41
Django's migrations table
0:30
More management commands
0:44
Squashing migrations together
1:25
Chapter review
1:51
Deploying Django Webapps
10:48
Intro to deployment
0:55
Deployment considerations
0:53
Parts of a web page are served differently
2:00
Managing static files
1:15
Protecting media files
1:34
Key and secret management
1:36
Hosting example: Opalstack
1:15
Hosting example: Heroku
0:49
Chapter review
0:31
3rd Party Libraries for Django
20:28
Intro to the libraries
1:59
Installing third party libraries
0:40
Django Admin styling with Grappelli
1:57
Grappelli in action
1:30
REST APIs with Django REST Framework
2:30
Writing DRF code
4:33
DRF browser view
1:01
Django Debug Toolbar
3:30
Using the Debug Toolbar
2:48
Course conclusion
15:56
Congrats
0:24
New projects and their structure
2:47
Mapping URLs
1:28
View functions
1:26
Template engine
0:59
Data object models
1:48
User management
1:01
Forms and uploads
1:57
Management commands
0:33
Migration and deployment
1:24
Third party libraries
0:49
What next? HTMX + Django
1:08
Conclusion and contact info
0:12
Buy for $59 + tax Bundle and save 85% Team Gift

Questions? Send us an email: contact@talkpython.fm

Talk Python's Mastodon Michael Kennedy's Mastodon