#100DaysOfCode in Python Transcripts
Chapter: Days 76-78: Getting Started with Python Flask
Lecture: Setting up the environment

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Alrighty, before we start any of the programming we need to do a little bit of set up, okay?
0:07 You can have a look at the, what you see on the screen here, and you'll see that I've got a bit of a folder hierarchy set up.
0:13 Now Flask, in order to operate, it needs the route directory. Now we're sticking really basic here, okay? What you need to do is you'll have an,
0:22 I want you to create two files, first and foremost. Wherever you're creating your Flask app, I've created it in this directory here.
0:30 I want you to create an app.py file, so that's this one here, app.py, and a data file, that's for the next video.
0:39 All right, and then also create a templates folder, like this one here, and inside create a file called index.html.
0:47 You can use whatever editor you want to create these files, just go ahead and create them, and leave them empty, all right?
0:54 When you're done, it should look something like this. And the one thing we're missing is we haven't actually installed Flask,
1:01 so let's install that now using pip install. Actually, what have I forgotten? I've forgotten my virtual environment. So shame on me, shame on me.
1:13 So, Python -m venv venv I'm just creating a virtual environment called venv. And there it is there.
1:22 Now we can activate that, activate, and now it's running. Now we can install Flask. pip install flask, installs everything it needs,
1:35 including those lovely Jinja2 templates, and there we go. As I mentioned the Jinja2 templates, that is what this directory is for.
1:47 So technically yes, this is a HTML file, but it's going to behave like a Jinja2 template when we get to it.
1:52 All right, move on to the next video and let's get cracking.


Talk Python's Mastodon Michael Kennedy's Mastodon