Take this
course

Software Development / Web Development

Learning Flask

Get started with Flask, a powerful web framework for Python that's easy to learn and use

Description

With a growing skills gap, the need for talented developers is greater than ever before. A basic grounding in building apps with a framework as minimalistic, powerful, and easy-to-learn as Flask will be a useful skill to launch you on a career as an entrepreneur or web developer. Flask is a Python micro-framework that makes web application development as easy as saying it.


This course will give you a basic grounding in the fundamental concepts of web development, as well as the hands-on experience you require to successfully build web apps with Flask.


We'll start by turning your computer into a modern development machine. Next, we'll move beyond static websites and develop a powerful database-backed dynamic Flask app. We won’t stop there, because we’ll also cover how to implement a full authentication system.


Finally, we'll extend the app's functionality by learning how to integrate it with third-party APIs.


When you finish this course, you will be fully equipped to build your very own custom web apps.

Full details

Curriculum

  • Setting Up the Environment
    The Course Overview
    This video will offer the overview of the course.
    2:00
    Text Editor
    Before we start, we will need a text editor to edit our code. • Installing the Sublime text editor • Creating, editing, and saving files • Navigating folders and editing files in the same view
    2:21
    Command-line Interface
    We will need a command-line interface for communication with the system. • Talking about the difference between a text editor and a command-line interface • Checking command-line interface options available for OS X and Mac users • Installing Cygwin for Windows users
    1:53
    Version Control
    To handle our project efficiently, we need a version control system. • Installing Git • Signing up for a new GitHub account • Setting up SSH keys
    1:55
    Database
    We will need to install a database in order to save our app's data. • Installing PostgreSQL • Signing up to use PostgreSQL • Creating a database for the app
    1:03
    Flask
    We will need to install a virtual environment where we can install Flask. • Talking about the importance of a virtual environment and installing virtualenv • Creating a new, isolated development environment • Installing Flask
    2:27
    Heroku
    To make our app available to users, we need to create a deployment environment. • Signing up for a new Heroku account • Installing the Heroku Toolbelt • Signing in to Heroku from the command line
    1:12
    Summary
    A review of the tools installed. Talking about the various tools installed so far
    0:59
  • Getting Started
    Project Structure
    Setting up the folders and files needed for a Flask app. • Creating static/ folderfor assets • Creating templates/ folder for web templates • Creating routes.py
    2:04
    The Request-Response Cycle
    Taking a look at how the files and folders together form the project structure. • Observing what happens when a user visits a page • Understanding the Request-Response life cycle
    1:14
    Creating a Home Page
    To understand the Request-Response cycle, we will implement a static page. • Creating index.html • Describing how rewriting boilerplate is repetitive and error-prone
    1:41
    Making Templates
    To write less boilerplate, we will use web templates. • Creating layout.html and filling it with boilerplate • Inheriting layout.html from index.html • Defining web templates
    1:53
    Routing
    To actually see the home page, we will implement a controller. • Writing routes.py • Running routes.py to view the home page in the browser
    1:47
    Using Static Files
    To style the HTML, we will need CSS. • Placing CSS in static/css/ • Applying CSS to a web template using url_for • Viewing the styled home page in the browser
    2:05
    Saving to GitHub
    To back up our code, we will need to push it to GitHub. • Introducing and using Git commands • Viewing the code in a GitHub repository
    3:02
    Deploying to Heroku
    To view the app, we will deploy the code to Heroku. • Adding more files to the repository in order to prepare it for Heroku • Pushing the app to Heroku • Viewing the live app
    1:59
    Creating an About Page
    To practice the repeatable workflow, from creating a home page to deploying it to Heroku again, we will implement another static page. • Creating about.html • Creating a new route and running routes.py • Saving our code to GitHub and deploying to Heroku
    4:29
    Summary
    We will put the process from creating a home page to saving it to Github into context. • Reviewing the Request-Response cycle and the development workflow
    0:34
  • Storing Data
    Creating the "users" Table
    Creating a "users" table in the "learningflask" database. • Understanding the request-response cycle with a model and database • Creating a 'users' table
    5:09
    Connecting Flask to Postgres
    Connecting the Flask app to Postgres using Flask-SQLAlchemy. • Installing Flask-SQLAlchemy • Configuring Flask-SQLAlchemy
    2:13
    Writing the User Model
    Creating a User model to communicate with the "users" table. • Setting up models.py • Writing the User class • Taking a look at how to encrypt passwords
    2:38
  • Signing Up
    Installing Flask-WTF
    To make web forms, we need to use Flask-WTF. • Outline where a sign up page fits in with the Request-Response cycle • Installing Flask-WTF
    2:10
    Creating a Form
    Writing the form's backend using Flask-WTF. • Creating a new SignupForm class in forms.py
    1:27
    Rendering a Form
    Writing the form's frontend in a web template. • Creating a new route in routes.py • Creating the template signup.html • Distinguishing between GET and POST requests
    7:49
    Validating Form Data - Part 1
    To check for incorrectly submitted form data, we will use validators. • Adding a presence validator to the SignupForm class • Editing routes.py to prevent invalid submissions • Editing signup.html to display error messages
    4:17
    Validating Form Data - Part 2
    Getting more practice in writing validators. • Adding an e-mail validator • Adding a password length validator
    2:03
    Saving a New User
    If the form data is valid, we need to save it in the users table. • Editing routes.py to save the from data in the database • Submitting some data and checking whether it's there in Postgres
    2:14
  • Logging In and Logging Out
    Sessions
    In this video, we will talk about sessions that are very important to sign a user in. • Describe what a session is • Use Flask’s session object in /signup folder
    3:34
    Sign In
    The sign in form allows users to sign in to the app using their credentials. In this video, we’ll write the sign in form’s backend and frontend. • Create a new SigninForm class with validators in forms.pys • Create a new /signin route • Create a signin.html web template
    5:24
    Sign Out
    Signing out essentially means ending a session. In this video, we’ll take a look at how to do this. • Describe how to sign out a user • Use Flask’s session.pop() in /signout folder
    2:32
  • Authorization/User Roles
    Authorization
    The app we have created still has two flaws with regard to security. In this video, we’ll take a look at these issues. • Take a look at how users can access pages without logging in • Take a look at how users get redirected to the sign up page even after logging in
    2:17
    Protecting the Home Page
    In our app, users can still access the home page without logging in. In this video, we’ll see how to avoid this. • Explain how to use the session object in order to determine whether a user is logged in • Use the session object to protect the home page
    1:55
    Protecting the Signup and Login Pages
    Once logged in, the signup page is still visible to the users. In this video, we’ll solve this issue. • Use the session object to protect the signup page • Use the session object to protect the login page • Introduce Flask-Login as an alternative
    2:42
  • Bookmarking Places
    Overview
    We’ll take a look at how to implement the location-based feature of the app. • Demo the location-based feature • Describe how the feature works to set up what’s ahead to implement
    1:55
    Adding a Form
    We’ll add an address form to our home page. • Create a new form in forms.py • Instantiate the form in routes.py • Display the form in home.html
    3:34
    Querying for Places
    We’ll take a look at how to query an address in order to find places near it. • Introduce the geodata API • Describe how a model can wrap the API • Write the Place class in models.py
    5:30
    Rendering Places
    In this video, we’ll render the places we need on the map. • Introduce leaflet.js • Render the map and the markers • Render the sidebar
    3:15
    Conclusion
    In this video, we’ll be wrapping and concluding our course. • Summarize what was done • Offer next steps
    0:50

Skills

  • Flask
  • Front-End Web Development
  • Python
  • Web Development

Similar Courses

More Courses by this Instructor