Advanced Scalable Python Web Development Using Flask
4.4 (73 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
1,506 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Advanced Scalable Python Web Development Using Flask to your Wishlist.

Add to Wishlist

Advanced Scalable Python Web Development Using Flask

Learn to create scalable web applications that can serve millions of users using Flask, MongoDB and Amazon AWS
4.4 (73 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
1,506 students enrolled
Created by Jorge Escobar
Last updated 12/2016
English
English
Current price: $10 Original price: $120 Discount: 92% off
5 hours left at this price!
30-Day Money-Back Guarantee
Includes:
  • 14 hours on-demand video
  • 1 Article
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • You will learn advanced concepts for Flask web development including Blueprints
  • You will be introduced to MongoDB and the concepts of NoSQL databases
  • You will learn strategies for scaling applications to millions of reads and writes per second
  • You will learn to use Amazon Web Services like S3 and SES through the Boto library
View Curriculum
Requirements
  • A computer with internet access and administrative access to install packages
  • Good understanding of how to use the command line interface, internet and code editors
  • A credit card is required to open an account on the cloud infrastructure provider
  • Good knowledge of the Python programming language
  • Good knowledge of the Flask web framework
  • Basic knowledge of HTML, CSS and jQuery
Description

This course will teach you some of the advanced development concepts used in the top tech companies today. How do I know this? Because I’ve been leading tech teams in both large enterprise as well as startup companies in New York City for the past 15 years.

Thousands of students have completed my "Professional Python Web Development Using Flask" Udemy Course, which introduced them to the basic concepts of Python and Flask and this course builds on top of that knowledge and takes you to the next step in web application architecture design.

The course goes through the process of building a social web application using Python Flask and the most popular document store database in the market: MongoDB. We will go over modeling best practices, how to build efficient indexes and how to interact with it using the popular MongoEngine ORM.

Step-by-step we will go over the user registration, login and management, the relationship model for users to become friends, and a scalable news feed system using the same architectural design that Twitter and other popular social applications have been using to handle massive amounts of user data.

Additionally we will setup and use Amazon’s AWS cloud infrastructure for this social application, and you will learn how to manage thousands of images using Amazon S3 and best-of-class email distribution using Amazon SES.

At the end of the course students will be challenged with a final project where all the course material will need to be used to complete it. Students that finish the final project will be eligible for special future promotions.

If you already know the basics of Python and Flask and you are interested in advancing your knowledge, this course will go over some of the advanced concepts of web application development, architecture design, database modeling and leveraging cloud infrastructure services.

The course is divided in 7 sections:

  • Introduction
  • Fundamental Concepts
  • MongoDB and Flask Blueprints
  • The User Module and an Introduction to AWS
  • The Relationship Module
  • The Feed Module
  • Final Project


The course has more than 13 hours of video tutorials as well as the source code at the end of each lesson, so that you can see exactly what the whole project looks like in each stage.

The course can take anywhere from 10 days to a month to complete based on how much material the student completes daily.

Additionally we’re constantly updating the course, adding contents thanks to the feedback of our students.

Join this course and continue your path to becoming a professional Python backend web developer!

Who is the target audience?
  • Programmers and developers with basic Python knowledge who want to expand their skills
  • Application architects who want to understand better how to scale their applications
  • Software developers who want to understand how to build API applications
  • Startup CTOs who want to understand better best practices for application development
  • Computer Science Students who want to get exposed to real life concepts
Students Who Viewed This Course Also Viewed
Curriculum For This Course
71 Lectures
14:03:38
+
Introduction
1 Lecture 00:58
  • This course is intended for people that have done some sort of initial Python Flask course and wants to learn advanced techniques for high traffic applications
  • We will cover topics like modular Flask application design, NoSQL databases, and scaling approaches
  • It is required that students have basic knowledge of Python, Flask and database concepts
Preview 00:58
+
MongoDB and Flask Blueprints
5 Lectures 52:10

Introduction to MongoDB

  • Databases and Collections
  • Indexes
  • Documents
  • ObjectId
Preview 07:41


  • To set it up you need to create a data directory: mkdir ~/data
  • You also need a log directory: mkdir ~/log
  • Create the mongodb config
  • Install mongodb by doing  sudo apt-get install -y mongodb-org
  • Start the client with mongod -f mongod.conf
  • Note: sometimes when your cloud9 instance goes to sleep without properly closing mongodb, you can get an errorexited with error number 100. Just delete the mongod.lock by doing rm -fr ~/data/mongod.lock.
  • Login to mongo mongo
Setting up MongoDB on Cloud9
07:50

  • Create a database by inserting a record: db.test.insert({name: "Jorge", last_name: "Escobar"})
  • Show the record by doing a find: db.test.find()
  • Insert another record and do another find
  • Do a find for a specific record: db.test.find({last_name:"Escobar"})
  • Create an index: db.records.createIndex( { last_name: 1 } )
  • Insert another document, completely different schema: db.test.insert({name: "Juan", last_name: "Escobar", age: 47})
  • Find that the record is still found: db.test.find({last_name:"Escobar"})
  • You can also do documents inside of documents: db.test.insert({name: {first_name: "Ricardo", last_name: "Escobar"}, age: 23})
  • That third record is not found: db.test.find({last_name:"Escobar"})
  • You can do conditional searches: db.test.find( { age: { $lt: 40 } } )
  • You can do AND searches: db.test.find( { name: "Jorge", last_name: "Escobar" } )
Playing with MongoDB
13:34

The factory pattern for Flask applications

  • Create settings.py
  • Create application
  • Create manage.py
  • Create a runner using:
    • Command: /home/ubuntu/workspace/flaskbook/venv/bin/python3 /home/ubuntu/workspace/flaskbook/manage.py runserver
  • Run the app using RUN
The Basic Factory Structure
15:57

  • Create the user folder and views.py
  • Add user_app and user_app route with a simple return string
  • Register the user_app on application.py
  • Run the app and check it works
Introduction to Blueprints
07:08

Section 2 Quiz
3 questions
+
The User Module and an Introduction to AWS
31 Lectures 06:34:21
  • pip install flask-mongoengine
  • add mongoengine on application.py
  • add user models.py
  • Go to terminal and do: >>> from user.models import User >>> user = User(username='jorge', password='test', email='jorge@fromzero.io', first_name='Jorge', last_name='Escobar')
  • check on mongo the record exists
Creating the User Model
14:42

  • Do db.user.find({'u': 'jorge'}).explain() and explain how indexes are used ("cursor" : "BasicCursor", "nscannedObjects" : 3,)
  • Set username and email as unique, explain unique
  • Add indexes (explain why indexes)
  • Do python manage.py shell and update the user and then check db.user.getIndexes()
  • Do db.user.find({'u': 'jorge'}).explain() and explain how indexes are used ("cursor" : "BtreeCursor u_1", "nscannedObjects" : 1,)
Adding Indexes
14:21

Register User

  • Create templates folder
  • Create base, flashmessages, formhelpers (copy and paste from github, not important to explain this)
  • Add requirement.txt > flask-wtf and pip install -r
  • Create user forms.py and add registration form
  • Create templates > user > register.html (note the url_for ".register", for blueprints)
  • Add user > views register
The User Register Form
16:52

- Implement the form error
- Install py-bcrypt
- Do the user registration with the salted password
- Try regitering with user "jorge" -- you will get a duplicate key error

User Registration
14:29

Unit testing is a piece of code that tests a unit of work, logical unit in the tested system. Your unit tests should be:

- automated
- independent
- consistent and repeatable
- maintainable
Setting Up Unit Testing
17:16

- Start a user test file
- Make sure to override application.py with `**config_overrides` and add the config_overrides
- Build the main tests.py file
User Registration Unit Testing
06:00

- Login function

User Login
16:14

- Here we use context (the with function), because without the with block, 
    the assert would fail with an error because request is no longer available 
    (because you are trying to use it outside of the actual request).

User Login Testing
12:29

- Create a nav bar with logged in user
- Create a logout function

Navbar and Starting User Profile
07:49

- Create a profile page
- Add the navbar to templates/user/login and templates/user/register

User Profile
09:51

Check username format with regular expressions

Check Username Format with Regular Expressions
09:17

- Be able to edit your profile if you're looking at your own profile
    - Check the edit_profile flag on views
    - Add the if/then on the profile view 
    - Create edit form and add bio
    - Modify user model's bio length

Edit Profile Form and Model
13:45

- Minor validation changes
    - Create a UserBaseForm class
    - Do a regex for username
    - Put email and username to lower case using signals (install blinker first)

Edit Profile Views and Templates
18:36

- Write a test for edit on profile page

Edit Profile Tests
17:16

- Explain how to send email via SES
    - Create an AWS account
    - Create a user on IAM
    - Go to IAM/Policies and attach AmazonSESFullAccess to your user
- Install boto3
- Set credentials in ~/.aws/credentials
    - Important: No quotes around your values
    - `[default]`
        `aws_access_key_id = <your access key>`
        `aws_secret_access_key = <your secret key>`
- Set region in ~/.aws/config (you can set the region on the upper right nav on SES console)
    - `[default]`
    - `region=us-east-1

Preview 11:29

- Create a mail folder on templates
- Create a base for html and text
- Create register email both text and html
- Add email to utilities/common

Implementing Email Templates
16:39

Increasing Sending Limits in AWS SES
05:14

- We need to generate a confirmation code
    - On user.models add email_confirmed and email_configuration
    - On user.views add a UUID and store on the database

User Registration Email Confirmation Code
16:21

- We need a view to confirm the email
    - Create a confirm route on user.views
    - Register a new user and check on mongodb the code
    - Hit /confirm/<username>/<code> with a bad username and a good username
    - Check on mongodb
    - Hit the correct username again, you should get a 404

Confirmation Code Functionality
17:48

- Now send the email when user registers
    - Create a HOSTNAME on settings.py (explain dev vs prod)
    - Change the URLs on the email templates
    - Send the email from register views
- We need to skip sending email when running test

Confirmation Code Testing
16:39

- Create a form for it
- Create a view to enter your email and email is sent
- Create a view to enter the new password

Forgot and Reset Password
17:35

- Create a form for it
- Create a view to enter your email and email is sent
- Create a view to enter the new password

Forgot and Reset Password Form Work
05:59

- Create a form for it
- Create a view to enter your email and email is sent
- Create a view to enter the new password

Forgot and Reset Password Views
12:25

Reset Password Tests

Reset Password Tests
09:47

- Create a form for it
- Create a view to enter your current password and two repeat passwords

Change Password
13:41

Change Password Tests
04:05

Image Uploading Setup
11:21

The Imaging Library
08:57

The Edit Form and Template for Image
05:40

The Edit View for Imaging
14:25

Setting up Amazon S3
17:19

Section 3 Quiz
3 questions
+
The Relationship Module
14 Lectures 03:10:44
Starting the Relationship App
17:34

Playing with the Relationship Model
05:58

Get Relationship Helper
10:50

The Relationship Frontend
11:15

Relationship Views
17:21

More Work on Relationship Views
15:22

Complete Relationship Frontend
03:40

Relationship Tests
16:58

Relationship Tests Part 2
17:42

Adding a Profile Image
09:33

The Friends Sidebar
15:57

The Friends Page
17:05

Reusable Follow Button
17:48

Relationship Emails
13:41

Section 4 Quiz
3 questions
+
The Feed Module
19 Lectures 03:24:30

The Feed Model
10:26

Adding the Feed Form to Profile View
06:36

Feed Views
15:44

Feed Process Message
08:36

Feed Message Template
10:48

Messages in Profile Views
13:21

The Feed Home
06:38

Feed Images - Model, Form, Views
18:38

Feed images - Resizing, Templates
12:53

Feed Timestamp - Milliseconds
07:38

Feed Comments - Model and Views
10:08

Feed Comments - Templates
08:42

Comment Cleanup - Adding Likes
19:51

Only See Friend's Posts
04:36

Don't Distribute to Blocked Users
10:08

Feed Tests - Part 1
18:55

Feed Tests - Part 2
07:30

The New Homepage
06:22

Section 5 Quiz
3 questions
+
Final Project
1 Lecture 00:55
Final Project
00:55
About the Instructor
Jorge Escobar
4.5 Average rating
742 Reviews
4,768 Students
5 Courses
Technologist, entrepreneur and open source fanatic

From Zero is an educational project created by Jorge Escobar, a technologist, entrepreneur and open source fanatic with more than 15 years of experience in the development of web applications in New York City.

Jorge has worked in well established companies like Yahoo!, Univision and MongoDB and has also been the technical founding member of various successful tech startups that have received multiple rounds of venture capital.

The biggest problem Jorge has experienced during his career is finding well rounded developers and he interviewed hundreds of them for positions in the teams he was leading. A constant pattern (no matter if candidates came from a good university or had a few years of experience) was the lack of practical, real world knowledge.

That’s why Jorge created From Zero, an educational project that would address those practical knowledge issues through training that builds hands-on experience and equip students with the tools required to be successful in today’s technology business needs.