So in various ways we have seen the multiple Red Sox, etc. and now we'll be seeing the basic sort of
risk simply being the simple, very simple of application.
So for that, we'll be learning the flask.
So this is a Python framework.
You can Google far more Python web frameworks using it more than flask.
So you'll get younger, etc..
So the reason I chose to ask is it gives you some freedom of choosing whatever you want.
So this flask has modules.
So if you want to use modules, you can use them other ways.
You can write your own code as well.
So if you want to use some forms, that is some WP forms.
So there are already like premade forms.
So you can just you need to import them and you can use those forms in your application.
So the use advantages of these forms are it will automatically do some configuration for you.
Suppose if there is a text fluid in this thing that if you did not submit any field and you click on
the submit button, then the phone will be a notification saying that this fluid cannot be empty.
So like that you can validate automatically with these modules.
You don't need to write any further code to validate everything the password for shipping, the food,
etc..
So that way we can use this module.
Sorry, can write our own code as well.
So there is another friendly that is called Django.
So that jungle is somewhat complicated, but Django useful for Fullstack applications because everything
is fully ready for you.
So you just need to learn that particular module and you do implement them.
So it does not give you that much freedom over press and press keys can be useful for small applications,
for medium basic applications.
So import flask.
So if you need to open the command prompt and type in style for us.
So this should be but I'm not going to do now because I have already done this comment.
Now so that too from press import start.
So this will import everything inside this first module.
Now standard convention creative ask application is for ask me to pass the file name so you can see
I'm just going to underscore name.
So underscore underscore name.
Use the special variable.
It contains the where you mean.
So whenever you run this application putting this file, then the name bind values mean.
Then that means we are running this all sort of know when to assign this to a variable app.
So not when we part of this convention apples equals two classes name.
So I need to be part of this convention as well because if you want to create some other score, then
you might get confused about this one in this app.
So now if I'm just going to underscore name is it goes to underscore underscore two main.
So that means we are about to check this name.
This goes to Main.
So that means when we are executing this pattern for binary render application app the current.
So let's go and run this one and hit it and see.
I use a production server instead.
So this is just for debugging purposes.
So let's go ahead and open this one
before that.
Let me please.
Let's say debugging is equal to two.
So now what?
You need to be easy to run this.
You need to import some environment variables and return this flask.
So that is the command you need to run to initiate this web server.
But that takes interact.
But what you can do is you can say after run, they will be sure to if you want to change any of this.
Bettencourt Then you run this fight again.
So with that or head, you can say with this question.
So the server refreshes whenever there is a change in this fight.
So now let's go and take a run and you can see, uh, the whoosh, um, IP address and the port number,
if deferred, runs on this fight then.
So what we can do is you can also support is equal to one third result like that.
So run this one.
And you can see the port number has been changed.
Generally, if you want to change the port number again, change like that.
So but you're not going to do it.
So let's run this and open this one.
And what you can see not found.
So basically what we're going to do is we are requesting the slash.
That is the main index of this answer because we did not confirm any of this index play this year.
So let's go and write some code.
So these are buried three are routes.
So you can see that it red dirt road.
So we are declaring some group we can choose trash group.
So this is called a decorator.
So whenever there is an event occur, we can execute some particular function that set the definition
undefined.
So index, we need to return something.
That's a return tag.
Hello?
Well.
So basically whenever there is an event for this one that is to rush in this item of obligation, then
this function gets automatically executed and this extra will be rendered in the browser as illegitimate.
So let's go and run this one, and we're about to open this up.
So if you open this and here you can see I don't want this control and you can see that Commissioner
Scott here.
So this is a simple loop you can define in distress.
You can also defend multiple routes to this single function.
So after that row slash index are going to say index, right?
So you can say like that.
Now, if I go to slash index, dart, hedge, DMA and freshness, I get the same result.
So here you can see multiple routes pointing to the same function.
So it's.
So this is input work.
Now what we can do is we can also use some dynamic variables in this group.
So suppose let's use a name slash.
I want to put some binary content here.
Suppose that I want to say so.
Username slash admin and it's user one.
So if I go to this username so actions are one, then I should greet with the page like hello everyone.
Okay.
If I go to this hello user pool, I should be greeted with her.
So in this case, what you can do is you can see if there is a username slash and you can say her name.
So what are the spelling precedent for this username trash name?
This will be president of the name variable.
Now you need to pass that variable into this name.
Now, what you can do is you can set printouts to see what the value of that matter.
So let's go and run this one and let's open this.
Username slash user one.
So we got the word and let's see the content of this new variable that is new.
You can see here the user.
This is the value of this second one.
We got this.
Now what you can do is you can come in this one and you can say hello.
That formed a tough name.
So that name will be posted here.
Now, let's go and run this one.
And whenever I say this slash username, slash user one and it says only one.
And if I go to slash user one, coming to it will go to your two.
Text each night so we can see the recipes dynamically generated and the content is also a language generator.
So you can see it here.
The written statement is like a spring.
What if you want to put some big heads down the page?
So the video contains more than one line.
So in that case, what we can do is we can find the tumor file in this one.
So first, we need to create a new vertical template.
So in that template will host our hydrogen levels.
So in addition, let's create a file index that legitimate.
So let's go and try to match GM record.
So that's some hit run tag.
Hello world.
Are we going to say welcome to my website
where they should be?
Now what we can do is we can set a written render template.
So render underscore template is the function.
So it takes you can see here, uh, the syntax.
Uh, the.
Now move past the fresh start when that is the problem.
You can just say index strategies.
The first automatically searches for the complete folder and the find them the strategy.
And the second one is you can also parse the
variable names so you can use that in this index strategy.
So we'll be you first.
Let's see how.
It renders.
So whenever we go to dispatch, it goes to index or attached to email, and it will render this using
this negative template.
And so this converting the inside user for dynamic content.
So we'll be seeing that in the few minutes.
So if you run this one.
So you can see.
Welcome to my website.
That is.
Let's go and turn here.
Welcome to my website boot.
And if I do this and you can see that genius has been immediately occurred.
So you need to be very careful on this render template and render converging.
So there is another function that is called render complexity.
So this is very, very vulnerable to this complete injection.
So we'll be seeing that now as well.
So I tell you, that user name, slash name, right?
So you can say index of nib, so that variable will be spared in this name.
So what I'm going to do is I can set vendor temperature to not name.
So let's going to run this one.
So let's go to a user name and user one and you can see the user one.
It is not even had to run tag.
So it's just that narrative I go to and seven.
It says seven.
Not only you should be very careful for these user input, it should be very simple and then it should
be possible.
This render template functions are compressed print function.
Now let's go and set seven in to seven.
And it is not myself under the seven.
Now what we're going to do is we are going to put a template variable.
So this will be seeing in a few minutes in the hatch cover.
So now seven in seven.
So now this magic gets rendered by this render template sitting and it was and performed this calculation
seven into seven.
Now if you hit enter and you can see the value 14.
So you can change this value and you can see you can see import if there is a margin bottom.
Yes.
So it can tell the system and it goes and validates that as a python code.
So I must again get quoted using here.
So that's why we should be very careful where there is user input.
It should be filtered first before putting into this template functions.
Now what we're going to do is return a render complete of index card.
So I want to pass this and then we'll go into this index strategy.
So what I can do is I can see, uh, Nim is equal to Nim.
We can see a username.
So you're going to make your name.
So we are taking the name value and placing in this user name and the user name value.
Host this name earlier and we'll be sending that in this index attached here.
So welcome to my website.
It's also said thank you for registering.
And here you can see the open breast, open breast and food places.
Inside this we can set username.
Now let's go and run this one.
And if you weren't interested, this and here you can see we're going to my Web site.
Thank you for registering back.
So this is how our templating engines work.
We can also build up python loops as well.
My loop for a loop etc..
So what I'm going to do is I want to show in this photo file for you so you can see open press percentage
and percentage equals base.
So in this we need to write the equal for I in range of let's say five, five times.
And what you need to do is you need to share again, percentage, percentage and buffer.
So you need to end this for loop.
So the templating enhances this and it bends for a loop.
So thank you for registering the user name.
We will print five times in the pitch.
So if you refresh this and you can see there are five times of this edge to take.
So that is a lot of this, uh, uh, converting units so we can uh, input the better by turn variables
into this and we can, uh, render them and we can use them as you wish.
So next spring we are going to see is.
That is, we can say.
You can also write my dad's records, too.
So we need to define the methods this group accepts so we can see the first one as a post.
So that means this Rob Disrobed only accepts the first.
He cannot perform the deprecation on this rule.
Now, you can see whenever I change this, we got some error.
So let's go and run this again.
We also have this error rates in this.
So we're retaining only the.
Let's remove this as well.
Let's do this.
So let's disrobing and accepting the post request.
So let's go and open the website.
And you can also see the good progress.
But it is not a circle defined that began to get and the push.
Now if I go and do this I can see the next challenge from a content.
So you can also get the parameter values using whenever you send this as it that request.
So what we are going to do is.
We'll be sending some parameters and their values or this great request.
And it's a name as equals to request that our accident get.
So this should get to the meaning of the username.
So that's going to run this one and then passing that name username as you goes to name.
Thank you for registering username.
So that username is equal to 69.
And here you can see.
Thank you for registering aggression against set.
I can change the value of that parameter and it gets reflected in this response.
So you can also do the post as well.
So first of all, the next one is so it requires some form data.
So then create a simple form and you can say request that form of that value.
So you can also that the request are cookies if there are any cookies.
So it is an empty dictionary for now.
So you can also say I request dark matter to see if the request came from the client is whether the
get are pushed out some other.
And here you can see.
Thank you for registering that.
So that is the
request matter to McClain has been requested.
Let's also see the farm data for now.
So that's another farm.
So in this one, what we're going to do is we are going to submitting the value so we can also see the
action is equal to.
We need to send this to another road so that.
It's about robust results.
So I'm just defending the results.
You can also name whatever you want.
So in these results, what we're going to do is actually sequence two to I can say it's GDP 127 and
of course, 5000 she deserves.
And this will be to your free time and thorough username.
And there is a name and then a tag by busy corners to text and.
We consider their type text, namely calls to our user name.
And the next one is submit button for type request to submit.
So they should do it.
So let's go to homepage.
So you're not running this for that.
Okay, we got some.
So that's a pass for now.
We can read the letter.
So let's run this and you can see and produce a name that will read this.
Thank you for registering.
So we're sending the value in the form that to me as the variable username.
So now what we're going to do is this accept the matter is equal to only the post.
So once.
And here we can say the name as equals to a request, not forum of the actual real name.
That is this username for configurable.
This name is a name you can just use some unique value is a name one.
But are we going to use a name where you
use a name?
Underscore where you know, I can just say return.
Welcome
that you want them to add this format of name.
So I think that should be integrated on the server and let's go and submit the name.
Take 69.
So the matter is not road.
Okay.
We need to say the matter is equal to force.
Sorry for that.
At something point this.
That's also saying that.
And you can see we got this results from our contacts in genetics the.
What you can do is.
You can also send the.
We can also put the value here.
So let's go and see the value is.
Let's build this one and Britain template and the template of index about its diameter and the name
is equal to name so we can put the name here and then.
I think they should do it.
So let's go and refresh this and you can see it's there now.
And here you can see in the same page you get the results.
So this is one of the better there because the you don't want every time to go to the new page and come
back from posting the results.
So Green Arrow, so you can see that's it.
So this should be very convenient.
Better than going to events.
So the term for the basics.
So if I forget any things I will be covering in that next videos.