 What's up guys? This is John Hammond. So in the last video, we were taking a look at Flask for Python and we essentially made pretty much just identical to the Example application from their their hello world program and the quick start guides and the online documentation So now I want to try and move on to some other stuff But first I want to take note of debug mode because it's pretty awesome for us as developers while we're learning and experimenting with Flask Debug mode will allow us to essentially work in a development environment that allows us to do some pretty cool things For one thing it activates the debugger So if things go wrong in your program, you can take a look at the variables and execute code while still being inside the application and The most important thing I think it does for us is it will reload our application if it sees a change in the source code That's pretty awesome. Well, we were trying to develop and test things on the fly So it explains how to do this with some environment variables But another notion is just turning on debug or setting Flask debug people to one If you want to use debug mode without being defined in a development environment You can do that with those environment variables on the command line But another option is in your source code to say debug equals one or true as a keyword argument to your application Run script. So before I do that. I wanted to showcase how this looks when you don't specify that You'll notice that debug mode is off here and we're in that running on that same application But if I were to change debug equal to true Suddenly we will have okay. Debug mode is on and we will be able to restart as we see changes in the source code So now that we have debug mode on it will reload our program automatically for us. That's pretty cool There is a strong note though because the interactive debugger Will essentially stop your program and show errors whenever things go wrong It gives you means to test your code and execute actual arbitrary code that is not good If it's kind of found in the wrong hands, right? So it can be a huge security risk if you leave it on for something that you actually put on the internet Because you don't want to just give your the users like little remote code execution on your on your web server and Python So that can that's bad. Do not use debug mode when you're putting something for real on the internet Okay, cool The next thing I wanted to get into was moving into URL routing because we talked about that Application route earlier in the in the previous video, but now we can expand that. Let's say we wanted to be Have a new route called say hello or Say hello, and it would be like hello YouTube and remember we'll have to change the name of This function because we don't want it to match the same as the other one that will have an error here Now the moment I save this you'll see that Detection or that change being found in the debugger. So if I were to access this page right here One two seven zero zero one or local host running on that development port five thousand We have hello world as usual But we also have say hello which we can read and it says hello YouTube just like that so say we didn't want to greet just YouTube we wanted to greet anyone in particular and That's pretty neat because we had the option to use variables inside of the URL There's some notes here in the documentation that explain how you can use it but essentially it's just denoting with greater than and less than symbols for the Variable that you want inserted into that URL it can be anything But you'll have to pass that in as an argument to your function here. So if I wanted to say Say hello to someone we can have say hello and then username can be name And they'll take in this argument name So we will say hello with a formatted string based off name and I will change some of these document Strings here even though they're annoying Sorry, okay cool. So now you'll see those changes being loaded and you'll see when we're actually loading pages That's denoted and captured in the log of our server. So that's pretty neat and cool to watch If you are doing anything for even maybe like a pen test if you're trying to see if you have an active connection It's good to log all those connections here. So let's go ahead and check out that page one more time Now, no, not only can I say hello on its own But I can say hello to like John and it says hello John and you'll see my Name is supplied as a variable and we can have anything in there like Doug. Hey Doug okay That documentation explains a little bit more where you can specify specific formats and specific types Like if you wanted specifically a string That's the default in this case. We didn't specify. It's just a name was cast to a string Integer float etc etc That's an option that we have here and remember these forward slashes you can like have as many of these as you want to anyone with a lot of Slashes like you can build out essentially a path or it looks like directories or how you'd normally see it if you were trying to write something in PHP but You're doing it in Python and you can define whatever URL you particularly want because flasks believe flasks believes that URL should be Beautiful they should be simple and clean without any file extension like a dot php your dot ASP X all that crap So you can have fine-tuned control and a lot of granular specification in this and that's a pretty neat thing So keep in mind that those variables you want to pass to To a URL if you're trying to keep track of unique identifier or something that has to be passed as a variable to your function as well So neat. Thank you guys for sticking with me. I do need to give a little shout out to my supporters So super huge props to these guys because they send me a little bit of love and I cannot thank you enough for that Every little bit helps one dollar a month on patreon We'll give you a shout out just like this at the very end of the video five dollars a month It gives you some early access to videos that are recorded on YouTube before they actually get released So if you did like this video, please do like maybe comment if you want to subscribe and check me out on patreon Thanks so much guys. See you soon