Up and Running with Git Transcripts
Chapter: Teamwork: Merging
Lecture: Configuring Windows and VS Code to run Flask

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now notice we've got this warning about flask not being understood what is happening flask is
0:07 clearly a well known thing. The problem is we don't have flask installed here.
0:11 So we need to install the requirements and whenever you do that it usually makes a lot of sense to have a virtual environment.
0:17 So let's go open our terminal. Now. We've got a bunch of cool stuff set up in our terminal notice to get things here. We're going to talk about that.
0:25 How you set this up at the end of the chapter for now. Just ignore that. We just want to do stuff on the terminal.
0:31 So we're going to set up a virtual environment, say Python -m and venv venv And it says we've noticed you've created a new virtual environment.
0:42 Would you like to use it? Oh yes please. We want next to install our flask here so we want to
0:48 make sure we activate our virtual environment down in the terminal. I think if I close it and reopen it,
0:54 it probably will do that. But I can just type venv scripts activate and now it's activated. You can see our prompt has changed here.
1:04 So the final thing we'll do Python not pip, install - our requirements like that. That should get flask installed. Perfect.
1:17 We go back here to our app.py and look the flask error is gone The final thing is to be able to run it.
1:24 Sure. Sure. I could come down here and make a terminal and I could type, you know flask run but that's not how I want to do things instead
1:32 I want to make it so I can debug stuff and use this little button and so on. So I gonna go over here through the run area and say
1:42 create a launch, Json and I'll say flask like this. Launch and debug a flask application that should probably do it and let's just try to
1:52 hit run sure enough. It looks like this is running here, I'll hold down control and open it and hurrah.
2:02 We have hilarity ensuing on Windows for this second developer but you know what's not funny
2:08 It's not funny that we got this working just fine on this other machine. So over here we now have Windows setup.
2:16 More importantly, just a second developer, regardless of their platform set up so they can now work on and develop this code
2:23 And by the way, do you see line five Michael, Kennedy seven hours ago, our basic flask app is when I originally committed that.
2:31 Super cool that we have all those things showing up there and yeah, we're all set to run and develop as that second developer,
2:39 we just checked out the code, created a virtual environment and installed the requirements and the extra step, I guess the step in both the editors,
2:47 we had to set up a flask run configuration so that we could run and debug it.


Talk Python's Mastodon Michael Kennedy's Mastodon