#100DaysOfWeb in Python Transcripts
Chapter: Days 57-60: Flask Login
Lecture: Setup: Flask and Project directory
0:00 All right, let's start this section off by creating
0:03 our environment, and pretty much installing
0:06 everything we need for this chapter.
0:08 First things first, let's install our virtual environment.
0:12 We do that using python -m venv venv, so we're actually
0:18 going to call our virtual environment venv as we have
0:22 in the other videos.
0:24 Once that's installed, let's activate it.
0:28 All right, and let's do some pip installing.
0:32 The first thing we're going to need to install
0:34 is obviously Flask, so let's pip install Flask.
0:39 We are also going to need to install flask-login.
0:44 We're going to need to install flask-sqlalchemy.
0:49 And let's install python.env
0:54 That should be enough for us right now
0:55 and we'll let that install nice and quickly.
0:59 All right, with that installed, let's actually
1:02 quickly check that out, so pip list.
1:06 There's all the stuff we're going to need
1:08 and we can then do a pip freeze.
1:12 Pop that into requirements.txt
1:19 There we go! All right, that's everything
1:21 we're going to need to run this.
1:24 Now we're not going to create too many files yet
1:26 we're going to look more at the folder structure.
1:29 I decided, let's call this project, "Project Awesome"
1:34 so we'll go make the project_awesome
1:37 and everything we need for our application is going
1:41 to be in that folder.
1:44 And if you recall, this is going to be different
1:47 to everything we've created in the course
1:50 so far.
1:51 We're going to be creating a brand new project.
1:53 In here, inside the project_awesome directory
1:55 just create a templates folder, that's where all of our
1:58 Ginger templates are going to go
2:00 and that's all we need for now.
2:02 We've created the environment.
2:04 We have installed everything that we need.
2:07 And we've created the folders.
2:10 Last but not least, we'll just throw that in now
2:13 just because this is probably the best time to do it.
2:16 Let's throw in that .flaskenv file
2:20 and in this file we're just going to quickly throw
2:23 in that Flask app environment variable
2:26 and it's just going to reference
2:28 the Python script that we are using
2:30 to launch our application
2:33 That way, if you recall, we can actually
2:35 just type in flask run
2:37 and that file is going to live
2:41 in the directory above this one
2:43 so I've actually created it in the wrong directory here.
2:46 Let's move it back up, so we'll move .flaskenv
2:50 back one folder.
2:52 And there we go. Now we are ready to rumble.
2:57 So let's move on to the next video and start some coding!