Building Data-Driven Web Apps with Pyramid and SQLAlchemy Course

Course Summary

One of the areas Python really shines is in building clean and powerful web applications. Once you know the language basics, this course will teach you everything you need to build data-driven, modern web applications in Python.

What students are saying

If you’re at all interested in Python, or new to programming, take any (or all!) of Talk Python’s courses. A friendly, approachable, and incredibly practical set of courses.
-- James G.

Flask or Pyramid Web Framework?

This course is available in multiple web frameworks. Of course, this page is for the Pyramid version. It's also available from us in the Flask web framework.

What's this course about and how is it different?

Full stack web development is exactly what you need to build true data-driven web applications in Python. Yet these courses can be confusing and overwhelming due to the many technologies involved (Python, SQL, CSS, etc).

We have taken great care to build a course that is just real enough to give you what you need without anything extra. We build a replica of a popular web application, Python's own packaging index over at pypi.org.

While building our replica PyPI, you will learn:

  • Learn about the different major Python web frameworks
  • Create a Pyramid-based website from scratch using the CLI and PyCharm
  • Work with dynamic HTML templates
  • Map URLs to view methods using routing
  • Make advanced use of routing to build a full custom CMS in 5 minutes
  • Take advantage of bootstrap to build well designed sites
  • Map data to and from Python using classes with SQLAlchemy
  • Learn how Alembic can help our database evolve as our models change
  • Accept user input with HTML forms
  • Add client and server-side validation
  • Overcome the special challenges of testing web apps (databases, frameworks, etc)
  • Deploy our web application to a fresh Linux machine (virtual, cloud-based)
  • Leverage our design patterns to convert our app to another data model (MongoDB edition)

  • View the full course outline.

Who is this course for?

This course is for anyone who wants to create Python-based web applications using the Pyramid web framework. In fact, you'll learn a lot of web skills that will translate across frameworks as well.

We do assume that you have basic Python language skills and can read HTML and CSS. But most advanced uses of the language or CSS are explained in the course.

Follow along with your own version

Students get the most out of our courses when they work on projects closely related to the materials they are learning or even follow along by watching the videos and then recreating that code themselves chapter by chapter.

We have organized the source code included with the course to make following along starting from any chapter a breeze. In the screenshot below, you'll see two directories:

ch09_sqlalchemy/final
ch09_sqlalchemy/start

The start version is exactly what we started with on the videos for this chapter (chapter 9). If you want to follow along with chapter 9, just copy that somewhere and get started. Similarly, the final version is our final result exactly as it was on video. You can even diff the two directories to see the changes we made or against your work to see how we compare.

Here is the starter and final code from the SQLAlchemy database chapter.

Hands on exercises

Concepts backed by concise visuals

While exploring a topic interactively with demos and live code is very engaging, it can lose the forest for the trees. That's why when we hit a new topic, we stop and discuss it with concise and clear visuals.

Here's an example of concepts reviewing the basic idea of routing URLs to view methods and how Pyramid selects from the various URL routes given a single URL.

Example: Concepts backed by concise visuals

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 Michael Kennedy?

My name is Michael, nice to meet you. ;) There are a couple of reasons I'm especially qualified to teach you Python.

 1. I'm the host of the #1 podcast on Python called Talk Python To Me. Over there, I've interviewed many of the leaders and creators in the Python community. I bring that perspective to all the courses I create.

 2. I've been a professional software trainer for over 10 years. I have taught literally thousands of professional developers in hundreds of courses throughout the world.

 3. Students have loved my courses. Here are just a few quotes from past students of mine.

"Michael is super knowledgeable, loves his craft, and he conveys it all well. I would highly recommend his training class anytime." - Robert F.
"Michael is simply an outstanding instructor." - Kevin R.
"Michael was an encyclopedia for the deep inner workings of Python. Very impressive." - Neal L.

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.

The time to act is now

This data-driven web apps with Python and Pyramid course is just what you need to build that fast, custom web application that can help you create your next great idea or just solve a business problem by deploying it behind your firewall.

Course Outline: Chapters and Lectures

Welcome to the course
18:39
Introducing the course
0:50
The incredible power of web
1:46
What is fullstack development?
3:08
Student expectations and pre-reqs
1:32
What can you build with Python?
3:44
Course topics
4:50
Meet your instructor
0:44
Video player: A quick feature tour
2:05
Setup
7:36
Do you have Python 3? How do you get it?
2:31
Useful code editors
1:25
PyCharm Pro for Free
0:30
Get the source code
1:15
Following along
1:55
Introducing the Pyramid framework
22:25
Choosing a Python web framework
3:41
Pyramid principles
4:13
Pyramid building blocks
3:31
Building block: Views
3:15
Building block: Routes and URLs
2:49
Building block: Configuration
1:49
Building block: Dynamic HTML Templates
2:03
Get the back story
1:04
Your first Pyramid site
20:34
Creating the starter project CLI
2:44
Demo: CLI starter site
7:54
Concepts: CLI starter site
2:40
Demo: Creating the starter project PyCharm
0:34
Demo: Creating the starter project PyCharm
2:33
Concept: Creating the starter project PyCharm
1:24
Project structure
2:45
Chameleon templates
35:11
Template language comparison
1:19
Template comparison: An example
4:38
Launching an existing project
4:38
Template demo
8:42
Concept: Templates
2:26
Layout: Motivation
2:20
Layout: In action
7:00
Concept: Layout
2:25
Project structure with layout
1:43
Routing and URLs
38:24
Routing overview
3:33
Demo: Routing, loading the project
2:45
Reorganizing the app
4:16
Adding the package-details route
4:16
Getting data from route
3:14
Packaging routes and views
3:11
Account routes and views
2:26
Concept: Using the routes
1:22
Route constraints
5:17
Demo: Building a CMS in 6 minutes
6:06
Concept: CMS routes
1:58
Bootstrap and frontend CSS frameworks
36:23
What we'll cover
1:34
CSS Front-end framework survey
2:05
Introduction to using Bootstrap
4:27
Running in a real web server
1:02
Intro to grid layout
2:44
Grid layout in action
3:13
Adding to the grid
3:17
Concept: Grid layout
1:37
Buttons and forms
1:20
Buttons and forms in action
7:27
Concept: Buttons and forms
1:33
Bootstrap themes
6:04
Adding our design
30:37
Our site design
3:29
The bare site again
2:57
Home page HTML
5:20
The making of the hero
4:27
Stats slice
3:41
New releases
3:33
Navigation and footer
3:50
Final footer
3:20
Modeling data with SQLAlchemy classes
49:47
Introducing SQLAlchemy
4:07
Who uses SQLAlchemy?
1:35
Architecture
2:14
The database model
3:10
Modeling packages
6:50
SQLAlchemy model base class
1:56
Connecting to our 'database'
4:20
Creating tables
7:09
Indexes
4:01
The rest of the tables
3:35
Relationships
6:35
Concepts: Modeling
4:15
Using SQLAchemy
50:34
Inserting data
8:18
Inserting the actual data
3:52
Concept: Unit of work
2:26
Querying data: Home page
5:02
Querying data: Latest releases
6:12
Working with package details
2:10
Package details data
6:43
Performance and lazy or eager loading
7:07
Concept: Querying data
4:03
Concept: Ordering data
0:44
Concept: Database updates
0:49
Concept: Relationships
1:59
Concept: Inserting data
0:37
Get the full SQLAlchemy story
0:32
Database migrations with Alembic
24:08
Introducing database migrations
3:46
Getting started with Alembic
2:33
Our first change
8:30
More database changes
2:36
Concept: Getting started
1:44
Concept: Alembic - the manual version
3:09
Concept: auto-generating changes
1:50
User input and HTML forms
52:20
The basics of HTML input
2:27
GET-POST-Redirect pattern
2:23
Register for the site (getting started)
4:06
Registration form
1:29
A little design for the register form
4:05
Register POST action
3:03
Getting the submitted values
4:52
Creating the user
3:39
Attempt to register
1:11
Login setup
3:57
Login form
1:42
Creating a user session (cookies)
5:40
Navigation items based on user sessions
2:24
Logging out
1:36
Concept: GET-POST-Redirect pattern
2:20
One source of data
6:08
Concept: One source of data
1:18
Client and server-side validation
25:41
Server-side data exchange
8:18
Server-side validation
4:57
The viewmodel design pattern
3:29
Viewmodel data exchange
2:40
Viewmodel validation
1:44
Client-side validation with HTML5
3:41
Concept: Client-side validation with HTML5
0:52
Testing web apps
52:16
Why write tests (web)
2:10
Special challenges of the web
1:47
3 types of web unit tests
2:46
Organizing your tests
2:19
Getting started with tests
8:46
Testing without the database
6:09
Concept: Testing view models
0:47
Concept Testing view methods
5:29
Fixing the 404 package error
3:08
Concept: view method tests
3:12
Testing the full web app
6:21
Concept: Testing the full web app
1:32
Sitemaps and testing
4:17
Sitemaps testing in action
3:33
Deployment
31:47
Deployment overview and topology
3:45
Creating our Linux server
5:06
The setup script and config files
2:25
Configure the server
5:37
Setting up our code
2:16
Configuring uWSGI
5:19
Configuring nginx
3:12
Concepts: Deployment
4:07
MongoDB edition
41:06
Introduction to the NoSQL version
1:42
Not a MongoDB course
0:55
How document databases work
1:14
The (new) data model
1:36
Connecting to MongoDB
4:26
MongoDB entities
7:15
Rewriting our queries
6:31
Final adaptation: user login
3:57
Importing the data from SQL to Mongo
7:14
Final cleanup
1:52
Concepts: MongoEngine and MongoDB
4:24
Course conclusion
12:50
You've done it!
0:37
Core concepts reviewed
10:51
Remember the source luke
0:56
Thanks and goodbye
0:26
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