Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Create a Portfolio Using Python and Flask!
You have completed Create a Portfolio Using Python and Flask!
Preview
We’ll set up a home route and section out the starter HTML into our reusable templates. Then, create a projects.py file to hold a list of our project dictionaries, that we can loop through in our projects.html template
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
From lowercase f,
import Flask with an uppercase F.
0:00
To start our site,
we must create an app variable and
0:01
set it equal to Flask,
and pass in dunder name.
0:05
Dunder name refers to the namespace
this is Its running in.
0:08
We'll be running this in app.py directly,
so the namespace will be dunder main.
0:12
If we were to import this
file to be used elsewhere,
0:17
it would take on the name of
the file it is located in.
0:21
In this case, app for app.py.
0:24
Now that we've created our app,
let's create our first route.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up