From the course: Advanced Python: Practical Database Examples
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Create a webpage with Flask - Python Tutorial
From the course: Advanced Python: Practical Database Examples
Create a webpage with Flask
- [Instructor] With our virtual environment set up, let's open up Sublime and start setting up our application. The first step is to set up a simple Flask gap. This version won't link to a database. Instead, it'll contain static content that doesn't change. Later, we'll replace the static content with dynamic links to our database. Let's save this file in our workspace. We'll call it app.py. Then we'll import Flask. We also import render_template, which will help us render our HTML files. Next, we'll initialize our application. We create it with the name of the file and save it in a variable called app. With this app variable, we'll be able to set up all the routes in our application for our website visitors to go to. Like we saw with FastAPI, these routes are the different URL paths in our application we're providing content for. The first route we'll define will be the home route. We'll link it to a function called…
Contents
-
-
-
-
-
Set up Flask in a Python application2m 20s
-
(Locked)
Create a webpage with Flask2m 52s
-
(Locked)
Build a landing page3m 7s
-
(Locked)
Develop additional routes to enhance your application4m 56s
-
(Locked)
Build a project tasks page2m 16s
-
(Locked)
Create a Postgres database2m 1s
-
(Locked)
Instantiate a Postgres table using Python3m 43s
-
(Locked)
Connect a database to a Python Flask project1m 52s
-
(Locked)
Integrate project data from a Database into Flask2m 57s
-
(Locked)
Integrate task data from a database into a Flask app3m 9s
-
(Locked)
Develop add functionality to add a project5m 7s
-
(Locked)
Develop add functionality to add a task2m 10s
-
(Locked)
Challenge: Develop delete functionality1m
-
(Locked)
Solution: Develop delete functionality7m 13s
-
-