Hello friends, I'm Parvez. And in this video, I'm going to show you that how we can create
a simple IP finder in flask. Now, this is a simple application that we are going to
create. Now if I change the for example, if I refresh this, you can see in the first that
show my IP address and my information about my IP address. Now if I change this, for example
to another IP address, and if I click on the search, you can see that I'm receiving this
this is the location, this is the country and this is the language, a latitude information
and also timezone currency and different information about the IP address. So now let's just create
this simple IP finder application and flask. Alright guys, now this is my I've created
a new project in pycharm. So now the first thing I need, I'm going to create a Python
file, and I'm going to call it flask IP finder. And after that, I need to just create a new
directory and you need to just I'm going to call it templates. So in here, the first
thing I need, I'm going to create two HTML files. The first one is index and the second
one is based on HTML. So right now, I'm not going to add any code in here. So first, now
for this, I'm going to use a IP API, the first thing you need, you need to install IP API. So
you can just use pip and install IP API. Now after installation, we need to import IP API
And after that, we are going to from flask, we need to import flask, also request and render
template. After adding this, now we need to create the object of our flask. And now we need
to create our route and also view functions. So I tapped our route and the methods. So methods
we are going to use get and also post. So diff index. So the first thing now
any I'm going to for right now, I need to just return render template
and I want to render my index dot HTML. Now let me just add some codes in my index dot HTML
So because I'm going to use template inheritance in here, now, I have a complete video series about
four hours training on flask web development. I've added the link to the video description
you can also check that. So now in the base dot HTML, the first thing I need, I'm going to create
block title. So block title. And after creating of the block, you need to end the block. So
end block. Also, I'm going to create a block for my body. So block body, and we need to end this
block. So in block. Now in the index dot HTML, I'm going to remove all HTML tags. And in here
I need to extend from the base dot HTML. So base dot HTML. The first thing I need, I need to create
my page title. So I'm going to use this block. So I can say block title. And this is IP finder
And you need to just end the block. And after that, we need to create a block for our body
for writing our body contents. So we can just say block body, and you need to end block
So right now I'm going to just create an h1 tag and flask IP finder
So after creating of our index dot HTML, and also base dot HTML, now we are going to just run our
application and we are going to check that we have our this HTML file or not. Now for this
we are going to just create our