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