#100DaysOfCode in Python Transcripts
Chapter: Days 76-78: Getting Started with Python Flask
Lecture: Setting up the environment
0:00 Alrighty, before we start any of the programming
0:03 we need to do a little bit of set up, okay?
0:06 You can have a look at the, what you see on the screen here,
0:08 and you'll see that I've got
0:09 a bit of a folder hierarchy set up.
0:12 Now Flask, in order to operate,
0:14 it needs the route directory.
0:15 Now we're sticking really basic here, okay?
0:19 What you need to do is you'll have an,
0:21 I want you to create two files, first and foremost.
0:25 Wherever you're creating your Flask app,
0:26 I've created it in this directory here.
0:29 I want you to create an app.py file,
0:32 so that's this one here, app.py,
0:34 and a data file, that's for the next video.
0:38 All right, and then also create a templates folder,
0:41 like this one here,
0:42 and inside create a file called index.html.
0:46 You can use whatever editor you want
0:48 to create these files, just go ahead and create them,
0:50 and leave them empty, all right?
0:53 When you're done, it should look something like this.
0:57 And the one thing we're missing is
0:58 we haven't actually installed Flask,
1:00 so let's install that now using pip install.
1:04 Actually, what have I forgotten?
1:06 I've forgotten my virtual environment.
1:09 So shame on me, shame on me.
1:12 So, python -m venv venv
1:15 I'm just creating a virtual environment called venv.
1:18 And there it is there.
1:21 Now we can activate that, activate, and now it's running.
1:27 Now we can install Flask.
1:31 pip install flask, installs everything it needs,
1:34 including those lovely Jinja2 templates,
1:37 and there we go.
1:40 As I mentioned the Jinja2 templates,
1:42 that is what this directory is for.
1:46 So technically yes, this is a html file,
1:48 but it's going to behave like a Jinja2 template
1:50 when we get to it.
1:51 All right, move on to the next video and let's get cracking.