Everyone welcome back.
So in the last video we stopped by installing the virtual machine of a button.
And in this video we're going to basically install flask which is the main web you know web application
package that we're going to be using to make our web services and we're also going to be setting up
the hello world.
And we don't have to understand everything.
Hello world just to make sure that flask is installed correctly make sure everything's working and then
in later videos we're going to be dissecting the hello world example and understanding what's really
happening behind the hood.
OK.
So the first thing is we have to install a flask and flask is a Python package so we can install it
right there.
So you can click control of TV which will basically open a new terminal or if you want to go to just
here and type terminal then you could already see terminal here and click on it.
OK.
So once you have your terminal open go to your desktop and then you're going to write pseudo app install
Python 3 so you want first to install Python 3 that that is going to ask for your password and make
sure you let it continue.
And it will basically install BIOS and 3 that.
OK so once Python 3 has installed you can go and write the install flask and then let it download flask
and install it.
And then once we're done then we now officially have that sort of flask.
So let's just make sure.
So less right by three.
And then you can rent important flask from flask in port flask and there should be no problem here.
So with installed flask successfully.
Now let's let's start and do a new project in the platinum flask and just one.
Hello world.
See what how this really works in flasks.
So let's first exit from here and then you can install any ID in a virtual machine.
For me I like to use ATOM which is a free ID but I know that everyone has their own preferred ID to
work on in Python.
So I have not that any I didn't do any videos to install any of the ideas but if you haven't installed
any ideas yet on this machine pause the video and make sure you install.
Any idea whether it's at home.
For me I use ADOM which is what it's going to come here.
I enjoy this idea a text editor basically But if you have any other things which you enjoy and you enjoy
writing code on then make sure to install it before completing the video.
OK so I'll assume now that you have opened up your text editor or your ID and then just create a new
file and then we're going to save it.
Save it on the desktop.
Create a folder and say let's call it tutorial one and then this file We're going to call it amped up.
Why.
OK now he doesn't have to be cold at all.
He y.
But you know it's just a convention and flask call it at IPY.
But it does have to have the Y extension of course.
OK so we will save that and then now we're going to be writing a very very basic web service in flask.
This is basically a very easy hello world and you don't have to understand everything about it.
We're going to explain everything in the later videos.
So this is just to make sure that everything is working.
So we're going to write from flask in port flask.
Make sure it's a capital F and then app is equal to a flask.
So the constructor a flask and then we do.
And after route and then define and then hello world.
We're going to find a new function called the lower level and we're going to return.
Hello world.
OK.
And then finally we're going to come here and say its name is equal to.
Or if a name is equal to mean then what do we do after a run.
And in these nine lines of very few lines of code we have essentially wrote web service that works in
flask.
OK so how do we run this Web service.
Obviously that's what we want to do.
So if you come here to and let's list the directories Let's go into a tutorial one.
Now once we're here we can see that up why file in front of us now you want to write that at the why.
So we're going to first derived export flask.
App is equal to and then wrapped up you why.
So we're telling Flast that the name of the application that we're running is called apt up.
Why.
Because our file is called at the Y.
Now once we export that we simply write flask run and that's it.
We have a fully working application that is running on be as and this address over here and it's listening
on port 5000.
So if we copy this you can copy using Control shift C and then you go to your browser.
And then write to here and then you're going to see in front of you hello world.
And if you notice year you might you'll get a message also that says get and we're going to talk about
this a lot more in the coming videos.
But yeah that's basically the Laurell program.
It's OK if you don't understand most of the stuff you're going to go into too much details off of every
single part of what we wrote and you should be fine even if you don't understand anything so far.
So if you have this halo wrote in your flask is fully installed and I will see you in the next video.