Bottle - A lightweight web framework in Python | Dániel Ernő Szabó | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Bottle - A lightweight web framework in Python

teacher avatar Dániel Ernő Szabó, Pythonista in the making

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

13 Lessons (2h 3m)
    • 1. Python Bottle Part 1

      8:56
    • 2. Python Bottle Part 2

      6:39
    • 3. Python Bottle Part 3

      7:46
    • 4. Python Bottle Part 4

      5:19
    • 5. Python Bottle Part 5

      3:06
    • 6. Python Bottle Part 6

      25:00
    • 7. Python Bottle Part 7

      4:49
    • 8. Python Bottle Part 8

      19:29
    • 9. Python Bottle Part 9

      4:14
    • 10. Python Bottle Part 10

      5:24
    • 11. Python Bottle Part 11

      18:05
    • 12. Python Bottle Part 12

      10:54
    • 13. Python Bottle Part 13

      3:35
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

10

Students

--

Projects

About This Class

Bottle is a fast, simple and lightweight WSGI micro web-framework for Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.

Github: https://github.com/r3ap3rpy/bottle-web-framework

Meet Your Teacher

Teacher Profile Image

Dániel Ernő Szabó

Pythonista in the making

Teacher

Hello, I'm Dániel Ernő.

I currently work as a devops engineer. I have several years of experience with various platforms and I'm here to teach some advanced techniques which may attribute your job security ;)

Cheers,

Daniel

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Python Bottle Part 1: Hello there in the comic. In this video I start a project which will consist off multiple parts. And in the first part I'm going to introduce you to the so called bottle framework by item . It is a Mike Faber for have applications And if you come from a number value, got to be family are with flasks. First, it will very best to you. And in this video I'm going to show you a little hello world application and tougher than plates and views. And in the following videos, I'm going toe progress toe The documentation and highlight important function is that you might be interested in. So here we are in the part one. I have created a hello world with PR and let me see the third. And as you can see, I mean my real trial environment and it is clean. So I need to stop battle. So this go out, grab the batter packages, install it. And after that, I am ready to use. So what can we do with this framer? It's very similar toe fest, but it has some key features which makes it different from so from battle. We will brought round and drought and browse. This is a decorator. I define, uh, before God. That's true, which is going to be the index. It is going to be coupled with the extraction, and all we will do is returned. Welcome bottle, stranger. Enough Today, all we need to do is call the round function, and here we specify the host that is going to be locals. The port is going to be a anything, and we will enabled me back so we can have a better picture off what's going on inside a bottle framework. So that's, uh, runny. So hello, Mexican states started fine. Arigato, my broza to this. You with that. As you can see, it's very, very, very family from the last videos I have showed you. It is a current missing, therefore become, but apart from that greeted us with the welcome to but a stranger. So basically, that's it. It's how you can write your first tell our application, but, uh, it has more features that I would like to show you, so let's go to the next one. So from matter we were also involved wrong for, uh oh, that's cool. It like what So as you can see, I am under the template to the name off the fighting spirit and less important. So if we want we can you stop? It's templates are powerful way just like in flask. It's a similar to ginger, but a little bit different. That's so rough before. Yes, Andi In sugar. Hello. Okay, Uh, name Well, on and off course, this should be four. And we will also need this infection. So let me stop the application and wrong you again. So as you can see, we have utilized powerful template. And with this, we can pass way of us that content to the template to get rendered in later time. It is going to be more important as I profess with my vitoria. But this Waas or for the templates and this templates can be assigned toe specifications. Let's see you. So I will also show that to you how you can use it, So Oh, well, you three What we were also needs toe in board you. And if we do this, we have no need for the temperate because we will have the view decorator and separate needs to record the same as we will call it in the templates. So it is templates finds differently loaded from the views for and in the view. For if you say you want hello, plate so you can create your own not say HTM our Thanks. Oh, name Welcome to buckle it. So look. And after that all we need to go to school in a dictionary. And in this dictionary we will pass the name, which is what. And as you can see, we have decorated Italy's index function with the route that is going to be out cause contacts through. And we have also decorated tweet the hello template. So now this were written a dictionary where the key is the name and the value is stranger and it is going to bust it after Rick loads the Hello template that CPR. And it will push the content off this dictionary to our template so less run. So I know you. And if I really loved it, you can see that if that I have this hello stranger to battle in h one h 20 markets. So this waas kind of all I wanted to show you in this first scene part off the Siri's and after serious. We're continue our progress with documentation and I will show you some need teeth centuries. I will include the playing for the documentation description. So if you like this video, give it the tops up and subscribe for more. Thank you for watching. 2. Python Bottle Part 2: Hello there. I come back in this video, I'm going toe continue my Siri's with the bottle Jack. And in part two of this series, I'm going to get your family with the arrows and read I It's so let's start with redirects . So when you may want toe reader act http request, for example, let's say you have a complex root which needs optimization to be access. And in that specific request, your Web server a Web didn't receive any kind of authorization form. Hooky took an at home. What an HTML form and you want to read. I'd at this Big West toe specify clothing for or something like that. So from mother, we will import. He died. We will have a room, which is a good day for its context. And here you will the place all to rise yourself. Go. Work is all way, will have this wrong, which is called looking for breast product. And, uh, this restaurant row is going to have some form or out door is the front. And if it fails, we were read that for the default contest route. Oh, let's just, uh and, uh, at me steal this from the previous videos. So, uh, that's right. Here we have the bottle upset around has hit this context. As you can see, we got the Please authorise yourself. Now, if I try to eat, there is I don't, as you can see, it is going to drop me back to the police, authorize your staff part off the well, and basically, this is just one way to utilize the redirects off course. You may use it in a very different way. It's That's just an example. So let me show you something physical. Have all battles that's important. Arrow brown. Wrong. Let's say we have been for for your message, Okay, this needs to receive air or as an argument, and we will tell you that the front prestes well, that's also created the Four strokes. Unless the waves with good, strong and uh, that's a welcome Let me steal is fine from the previous That's stop the execution and runny yellows. So now if I eat this context route, I received the message. The four or four Aramis each were come into place when you want to get something on the well up, which is not as you can see the response waas that electricity content waas not found. If I want, I can also define or override the response message for the 41 which means that this is a typical and the message you receive when you want to access something that you are not or at the moment off arrest access. So you and, uh what I want to do is great comfort soup You go and song What bus function handle analysts aboard with 401 good wards world that's gold. And we start this so way are getting that on you. So no must give us back the overdone response from the 41 at a message. So basically, this is what I want to show you in this video if you give it a thumbs up and subscribe for more Thank you for watching 3. Python Bottle Part 3: a little, then come back in the bottom three off my videos in the battle project. I'm going to show you something political, which I actually like more in the butter projected in the last picture. And it's the way that HBP methods are handled. So let's get to it and is going to be something to do with the decorators. So from we will be forced again before and the wrong way will have this gets that corrector for released convicts court, and we will welcome message it was We will also have what and here we will find the index post and you're welcome Black and also this with very sticky cannot. So next come to let's steal the brown line from the place in your That's the event for and around this. So if I get it says, that's why I come to the bottle. What I'm going to go. They start another. I don't import very best, you know, I would first need it, but let's do it in another way. So oh, he's so requests now If I started by an important request, what I should see when I go there. It twists that post let's get you Wouldn't is a 200 response with the text. Welcome from post to batter pressure. Now, if I bought the delete, I get the response that I welcome from the date to battle Pleasure. And, uh, this is, uh I don't know why, but but I like it more than how you do it in fast off course. There's a similar way toe No, the same in battle. So that's going to request. Like and if I want, I can do the same. So roles And this throughout his bank toe. Yeah, give it. And, uh, I also need to import the request from the battle project. And but I think this bulls Andi Yeah, I will be done this. So that's, um so if I get, it's I will have the welcome to, but a present. If I used the best menu to call the really http function, I get the other response because the post we get the correspondent response. So Nisa different approaches to the same problems solution, and, uh, I don't know why, but but for me, it feels that this is kind off better. So let's say you have these about the application. And you have these Someone yours on you would say that you define or get that created functions in get my application Someone you and all the post functions that created in the post my application Someone you. And this way you can keep track of all the possible ways you can interact with your web application. So this is what I want to show you. If you like this video, give it thumbs up and subscribe for more. Thank you for watching. 4. Python Bottle Part 4: Hello there. On the wall. Come back in this video. The part for my butter project cities. I'm going to talk to you about query strings and how you can pull the information off your queries, uh, with the half context route and decide for directions based upon the information that was specified in the query. So let's say you have this forum kicked age where you want to fabricate You are us and busy . What else? Look something like this. So let me import first from the battle. The throw Run, please. And well, basically, we will also need the request and we will create throughout for our quickie page. And when I hit this on the throat, I want the associate its function call wicked babes Toe at first just drained the query string that Waas provided. So let's say our wiki page has the bay Jaidi and maybe a section I d So the page i d we come from the request that query the big find the section come from the request That query that I think so cresting may look something like this in our case a wiki page question mark be joining in force and Waas. So first we would like to return them please with, uh following look. So I think. And I think I just thought, Is that here we brought up to give it the proper naming. So the page I name is going to be paid section is very big. Let us run our motto server So the holes look close. Good boy, say anything. Can you? Let's see how well this there's. So run it on. Let's hit Our different context meant it was not found. It's perfectly fine, but where I hit, no one could base. I can see the direct arrested Ricky Page and nothing. So basically what we could do is create a let's, say, failed solution. So if there is nothing specified in the query string and they hit the Wiki page context route, we want toe. Give it some default values and that's right again. And what back me out section. Let's start off servers now. If I hit it with the specified query, I should get to the firm past. As you can see, the requested we keep each stand on the section is being be just like I specified in my query So this is what I wanted to show you in this part. If you like this video, give it thumbs up and subscribe for more. Thank you for watching. 5. Python Bottle Part 5: Hello there. And welcome back in this video, I'm going to show you something pretty fun. I have recently discovered when I waas embarking on the journey off my butter period and at first I have notice that is no such function by the fort like it's in the last when you're when you let's say, change the configuration file and it automatically reloads the flats server to pick up the changes. And there is an easy way toe result this problem by being the real older. It was true when you're on your butter application, so let me show you how you can do that. So from in your drought just to be saying you were paid before the next route and welcome message on, we will run ourselves post. Oh point, a painting on real older people's true. OK, but think waas true. Let's save it and so let me hit before the shoot. I want to run the script so cool. As you can see, we have this welcome message. But what happens when I had another contract? If I didn't that that people around you to the start function, then I would not receive any kind of fortification that the but WAAS automatically reloaded . But now, when I say it's fine, as you can see it, pick that changes and it's very started application server. And when I hit context, I had the response. So basically this was a really short video. But if Mac it give it a thumbs up and subscribe for more, thank you for 6. Python Bottle Part 6: hello there and come back in this video. I'm going to show you something pretty put about the best projects, namely the Clantons. So, uh, as a micro framework, but the project alone itself is pretty capable, but the party system makes it more to report on allows you toe extend the functionality off your projects or applications. We'd let's say that sequel database on other kind of planets. And in this video, I'm going to show you how you can database as a back end for your edification. So that's that. Three. Create fine, not see it things you want and thrown the bottom project, we will import there. Oh, the install and family we will create around. So let's say this well modification supports une mandatory off computers that you have in your organization. So, uh, we will We would like to provide a way to query specific devices that are in our inventory based on specially criterias from the database. So we would like to call this context route the show and really well, a search criteria cord. That's a device which is going to be a stream. And we will define our so defense. We're best on the device name as an argument and somehow we would like toa extract the information from our database. So what we can do is hunt the plugging for this. So you and a part face and with big we were yes. So long, I think. Well, I and until it completes it waas pretty fast, actually. So from bottles, people, right, we will import Go light and we will call this stock. Well, duh. See the light clicking and the DB Fine we have Here is the no fax backsplash in round story . This is going to be around stringing things. I'm on Windows platform. So what we would like to do is passed somehow to this contacts the pointer toe like and we can do this with Devi argument. After this was done, we will have toe execute query against our database. But first, let me create a database and we wrote do this in the present for and it is going to be called inventory. What on this is going to be the one that contains the devices stable? We're goingto have 94 device. Yes, it is going to be an integer on. Let's make the primary key. We are going to have the name off the device that is going toe tech story able And let's say we will catch us here. That is also going to be That's what So far, so good We have missed a database and we can on Sunday so introverted cord and there waas its windows seven. We will love the new part. It is going to have your i d off to. It is also going to have. So what's wrong? I had a date of it is interesting to be told pc it is going to have Windows eight. It is also going to have another record that's going to be called Andi. Just paint. It was so far, so good. We were right changes and after this we can call our own, which will be the result off TV. That and said feuds and we will accept you the now what waas it called. So let's open it. So we have a stable. It has you waas the name That's so they say, and from the devices where it waas question and this will be a device. So this is our command that we want. We have executed against our database. And after that, we need to fetch Toral with kiss. Come on, come on. Well, and we will return our template. Well, uh, ball And that's right, our educational. Okay, so Oh, what a line is in those Imran Doherty plug ins. Well, that's just golden. There is no such context. That's different context route. So we will show the device when name is called and it returns. Not so. Inspect Cold Fuck! Where is my It is going to be Go sell him. That's right. That changes. They start our competition several. And as you can see here now we have this amazing result. We chose us that we have a row object from the secret life And if I want to and expand it But I can do is call that by the field, so I and I will still the name on the U. S. Okay, let's restart our applications. As you can see now, we were able to specify this on, say, query toe context wrote it goes toe our secret lies back and pulls out the information so well I can do is create this or condition And if we have a row, then we want to renders. Otherwise we will return a template saying that I give eyes cool and this is going to be a bit more religion. But now the device name needs to be pushed the template. So if I run this again and credit my database again, I can see the right result. But if I give it something that you I had the response back that the device with the specified name you can't find could not be found. And what I can also do is create a query like context route. So I want to make sure that this works proffer properly. So the around, So I don't have a query black function. And here I want to reuse the part from the previous video. So I import also the requests. Onda uh, here, As you can see, we have the query, the page I did that section and so on. So what I want to do is create a fairy where I can specify. I need os order name so haven't had us from the grid Quest. Glady os. Oh, I had the idea from the request. That query I thought you know and, uh, also So if I have a no us. So here we have three cases. So if I have a no s, then I can say that I got another Well, say string to the TV execute. So I will have this very stream that is going to be all right and in necessary If I have no s, I will a band to the breast, Uh, os course if I have a 90 I will do the same thing. And if I have I mean I will also something similar. So this is just, uh, 50. So let's call it with for the first time. And we were returned for extreme So that Mary, start the application. Start it again. Andi. As you can see, we returned Nothing because our choir listing is nothing. So the last string is zero. Because that would mean we could put anything to the choir skin So it stays and being and the land off Lantieri zero. Then I returned in the otherwise I will return a stream. Eso have hit the public, Stewart, Once again I got the invalid. Wary? No, what I want to do The join was father practiced thing and you will see with his own. So as you can see, I have being what it is. Yeah, yeah, I should be one and the that same people, It's up. I forgot to replace it. But now we are getting closer to our final solution. So let's started again. Okay? It is running and weapons, and do now is to create this query for my database. So you now I four months this song and return the whole wary. So that's way around this. So it was like, I need a name. The olestra devices where I equals one and name it Waas. So we will also have this robe which will be fetched by the common. And this government is executive version offline. Query. Now, if we have a role, Donnelly shows return the template. What did I do? So we should return a basic adding the name on the U. S. And otherwise I, uh the query string. Uh, okay. City. A name could not sell the name across the past from, so that's save it. Right? And war leg name. They not defined because I forget us, everybody, ever. But once again, it should be a guide off. Fine now. No, Such come. Why does it want to come? Let's bring it again. Really? Yeah. And investigate show, idea, name. So go by. But Dan's exceptions. I should grab before diplomats say us. So let's see you. What? He would have him and me in course. Team. That's Golden's. No, such So it's a bit there. Yeah, I can. Let's see how well, this first. Now the device with the specifications. I need waas one and name a lot could not be found. Okay, so what if I say the name is black, Okay? And e os gets also lack. Okay, this is the solution. Oh, good. That's straight to you, So Oh! Oh, I think they all wrong. Oh, cool. So on the problem Waas that there was nothing wrong, actually, with the strict I wrote so we can leave, They sign. Yeah, And the problem was that I was referring to the wrong Islay so madly starts to and I was referring toa one. Okay, that strikes again. Sold. So the idea one as you can see it, cannot find it. Yeah, I need to We have this laptop. Three We had this piece on the island for his doublet. I waas If I say that the U. S. People straight actually get the same response here. So this Waas the stuff I wanted to show you If you like this video, give it thumbs up and subscribe for more Thank you for entry. 7. Python Bottle Part 7: Hello there. And welcome back in the parts of it off my butter project. I'm going to show you how I answer fights with half this application. So there are two ways you can survive. As you may know, this by default The browsers. What toe? Show you the fast you are trying to serve. And in this application, we will have to context boots. One is going to be for showing her face. The other is going to be for the holding fast. So let's get Teoh. What we need to do is import from the battle. This there are so I hear you would have to show quote stroked, which takes fire. And you, you will have expired and we will return the stuff IQ five file course The role String and Stroup specifies where the Web server should look for the fais based on their names. If you want a toe, specify conduct stool, which is for downloading. We sure doing this Say so Way aesthetic. I am from the rules and down it waas fire. So what this will do is it will force the brother to download specific fire with fine So run slow calls four. True. Let's save it. I have Ah, pretty bad picture and a pdf file for you so we can check this out. Oh, all right. Don't. Andi. Yes, now, it should be fine. So what I'm going to do is show you, you know, you know, here we have a five. And if you want, we can let's say downloaded by, right? Anything But here we have this little ducks, the media, and as you can see it, shoulder my media. If I want to download them explicitly, I need to hit this context. Good. Don't Jake back. Uh, okay, let's restart. So now that Donald So Oh, James bag, as you can see, popped up the window what I want to do with this. And, uh but, uh, it also show me the back window and told me to decide what I want to do with that. So this is a kind of easy way toe implement. Let's say Hillary or download service and so on. And if you land this video, give it that subscribe for more. Thank you for watching 8. Python Bottle Part 8: Hello there. Comebacks In the far date off my butter project, I'm going to show you how you can create a simple web up to store up man. I mean, store and download and show fais with your application. So the structure of our application will look like this. We will have the uploads for her, the views and the script that is powering it. So the first thing and went create is the index template. So this way you can actually around conditions and Bytom courts in the but application. We had something. We will say that each one list close. This is going to be in on order list and what you will do enter it over every upload in the Atwell's and create this list item No, lo, Let's close the back and on before otherwise we will say that you do not have any boats. Okay, Let's right that by conscript for that. So we were in court Rock Rose. We will have the different context route that is going so things like speech, the plate, the name Unless on yeah, clothes from the horse list. The what is winning portrayal small and no, if we're on the application on our clothes. We should see that we do not have any uploads. Who will? Okay, let's, uh, change it. So we will have the Oh, that's no. Oh, that Z let's important. Get on the post and we will get Yeah, well, that's start. We will define our function, which will do well. I have ordered brick bad this for for you. So only does IHS interest tons the HTML form which allows you to upload. Okay. And that is, uh, catch. But wait. We need the rest of our application on calling the up close Contact Stroke. I would like to remove this cut The Gordian input time and all we have here is the bro's and startle upload. So let's populate our course Action for the buffalo. That's look. And basically what we would like to do is create our up both And for this, we need the request important from battle on the repressed form. The get this is going to be defined. That was selected. We will use the name next has the correct rest for a while. The or us the past, but split next, good and what it will do is, it would separate the fine name from the extension and we can specify that we only want toe up. That's a PDS and images to be uploaded. So if the extension is not that gene thing, not be that the f Okay, then we would like to return a message stating that you are not allowed to upload this kind of fire. So oh, big extension. Otherwise, what we would like to do is safe. Our clothes and our safe bus is going to be follows. Think waas growth string. Andi, this will do the following. So if we don't specify any other arguments just the past, it is going toe Try toe, say it to the specific location. But if the final exists in to raise an arrow So if you want to do this, we can, or specifying the whole that's true. Fleet will upload five regardless off. Let's say whatever our keep your state are. So if we had a fire, that one and after that they were returned the Okay, so let's start our why do it puts call over. So Okay, I see we do not have any books, so we want to upload this time. Let's call it Demel form that. Okay, start upload. Does it go see? Yeah. From? Yeah, thanks to my I would like to sect the same form start, and it says that I do not have any kind of fire name, but doing so. Yeah. Yeah. Go. And I also have here the five. This is okay. Just say it is okay. Let's try to shoot it. Oh, - but that spring our for so we get a better look. - Okay . Me what? I miss thing. Best them. All right. So it seems that time forgot out treats the documentation. It's not form, but fights. Okay, so now it may be better. Oh, it says Okay. It might have uploaded something and Well, yeah. So we have got this war paper less upload something else. PNG's. That's also I come. Oh, it seems to be I think so. That's remove our category on, uh, still something. Uh, so let's say we would like to go create the Lord Four. That not one down about presentation part for this. So we should create on a trip h janitor that point to our apples for the with the upload name rules Well, Oh, yeah. So now we will have this ankle. And after that, you know, the base things. We should have something like this. Now, here comes the place high here comes into place the maybe the previous video where we have these show and Donald fights. So all I want to do is show the contents off that specific fire. So, uh, go and grab the fire from the up loads for them, and it will open it in a new tub. If I specify that, it's yes. Pay falls under unless restart. Our website I have drilled is this, and aesthetic fight is not defined. So we have nothing less again. We start this web server, go forward. What did you know? Go for the PNG and I have modified. Okay, now this is the last that's throws things, the class that things. And it says that we cannot present this wallpaper because it contains Arabs. Maybe the fire was corruptive. You're in the apple, but let's go and upload our pill yet, for it says it's OK. Let's go to our sometimes and it's working. So after sweating blood and tears, I finally was able to complete this apprehension. So this is what I wanted to show you. If you like this video, give it a thumb's up. It's good for more. Thank you for 9. Python Bottle Part 9: Hello there in this video as we draw near to my but a correct I'm going to show you in part on how you can create a simple counter. We choose this book kids toe count. How many times the specific page was visited by a single year? Was that so? That's, uh, from the bottle. Bring to the boil. It's, uh, say great. He's ur anything around on and the request in the response. We are going to have a single grounds. Does this mean that's here? We will have a count which were get as Annan creature from the request, the cookies and zero. If it's not available, we will increment the count by one and we work, said the cookie. The response. It is going to be called to account and it is going to be in a string off Come and we will break down. You, thanks way will dry on 84. And so now if I hit this street, I should receive way I have made staying. Let's core so after grouped cookies is not seems like, really easy to make this type of messages so even visited. Want time to attack three times four times. And so and the basic idea is toe Try and pull the counter cookie. If his present, we get the value. If Matt, we get zero. So we start counting. You can combine into it a session based approach. So you have user which authenticates and you may want to measure the frequency or the activity off the users. We are these Cookie. So you're You said this cooking when they yourself I've seen you Check what? I have pages. How many times is it? And you can hear statistics from that. So if you like this video, give it a thumbs up and subscribe for more. Thank you for watching. 10. Python Bottle Part 10: Hello there. And welcome back in this video. I'm going to continue my battle, Siri's and I'm going to talk about the dynamic crowds and how you achieve a flexible functionality with battle framework. So let's do it. We were called It's time, Okay, As usual from the battle we will import and the road. So we will have a route which is going toe point to a forum. Big hi four. Call it four Whoa. You okay? Name for you can also provide fully flexible and customizable backstroke. Let's say you have an applications in which you want to provide a way for users to let's say I look themselves if they have looked them out themselves out in the active directory. And you may also want to provide other functional thistle, not just a low threes, that possible dance on active force. And you could say that you want to specify an action and use only that's calling my major and we will cross the action on using So we will return the U. S. That so you was four months. So let's take It's for That's right. So our cost you post the board and you told me about is going to be true. Get a lower case. Oh, save it And we should just and run the So if I go here on duh his different sort, as you might have expected. Need it were given 44 enormous situate say's that it could not find it. So the drought is not defined. But if I hate the forum, we, uh but saving him he says that your feet, the specifications name. If we say that we would like to perform, I look action on the user name. Remember way could take this context route and it says that your specified the action look when there's any raper by. So what can we do? Witness. So if no one specifies named for the four or we could say that lift with forum is Kathy. And if I we thought I'm going to say I hate just before context route without any name and it says nothing because I'm missing before slash. But afterwards, four room. It also says nothing because I need to specify another decorator. We should state for him and Waas. I have restarted my education and he the same context, right? I should get a different value with the specifications for So basically, this is what I wanted to show you in this video. And if you like, give it thumbs up and subscribe for more. Thank you for watching. 11. Python Bottle Part 11: follow that. And what, Come back in this video, I'm going to show you some faster that you can do with a city. People, kids so physical here. The idea is to have a site which requires looking and after looking, depending on the number of times the user visit to this site. If it's a first visit, you might want to give him or her top tool over the website. So what can go? She can go to be found how to do staff and so on. And for this purpose, the cookies are an excellent way to go. So in this moment, I'm going to show you that So from, uh, let's save it. So door, you are so from the battle, we will watch drop what is fun wrong. So we will have this Trout says, Well, this would be the route to which they use a really redirected after a successful authentication. So welcome gets, um mm. Get no arguments. But if during west, the get cool with this present, then we will come. Welcome. But, my dear friend, otherwise we will said in the Cokie off the response. I think so. I said yes and we will return the ah Oh, a stranger. Is this your first? So you may get the idea. So in this part, the because, uh, some model off the battle family we'll check if the cookie exists. We don't care about you. We just want to jacket that cookies person in this part. We will assume that if there is no six about that, we should set the responses. Cookie Don't visited. And, uh, this is how you go with. So we were on on the whole local in the booth. True. That's Ah See it on as it's still good, we will get no response from the different context route. But from the welcome, we should have the later response. So Hello, stranger. This is your first time. And if I refresh to process, he says that Welcome back, my dear friend. So how can we aren't the That's a authentication part. Let me search for okay. Uh huh. I think that this waas not made as audio yet, but you may be able to pull something together. I kiss. So let's go with the pdf story. Semper. Here we have This form is a night action. I need this form. As you can see, we have this, so that's fine. And suddenly button. So first time in a city case came out And what stuff? So Okay, that's going this. So if we get the loving but, uh, SE, it's called a past story, and this is going to be caught, we're post it to the welcome. Oh, just looking, But And we will have this good luck. So that's an implement. A simple So, yeah, just broke. Um, this thing that, um, is request Mementos. People's get this for I need a fuck up. And otherwise, we will check the stuff, but first seen if it is working, I started. So that's calling. Maybe. Yeah. So this is going to record user and plus cool. So we will return first. The request. The form that Plus for what? Sticks? Yes, it was for that's that's restocked our No, no, we don't not want to. So well. And now, you know, I was going to be a man on the best service. Best four back. Oh, but after having it, it should be okay. E best forms. Yeah. So, Michelle, Zack, if the requests user is Yeah, Okay. the request, homes. What spooked? Watching the best. If that's the case that we haven't got me looking so we should set the response Kooky. Uh, yeah, to the welcome. Let's have another case where we, uh, and reach user. So this is going to be in court? Just seem to use up on and the best is nothing. So we were sat cooking? Yes, every time. Welcome. And we should check if way I mean Cookie. Welcome back, Mr. Otherwise I live God Sinclair us up God, we will return that you are just in. Otherwise, what should we do with this? Otherwise you will set the response. Okay. Don't. Yes. Yes. And you're also on if we have a guest which we assume if it's nothing happening are simply use. Then we were get ok. Oh, no, we don't so the same. That welcome. Yes, maybe that my leaving. Okay, so give it the drugs. So we hit the default construct and we specifying that in the US and it says the truth. Okay, but now is there. So we're looking and it says that Welcome back, Mr Administrate, but if I say it's a simple user on the bus and still Yeah, because we still have a cookie. Well, so So me this is getting a bit more so what? Let's figure it out on our So between port, you do not talk that response so long from and we say that we don't response and way can Did you cook it? Oh, yeah. So response it, cookie. And we did it the same call. It's the best. And this goes for the context from the Jews up during cooking and a guest. I know the guest. Well, yeah, man Onda sinful and take it for a little nothing. So it says that we have these limited. We'll go with pass. We have to act on back. Administrator. So that is Ah, Let God. Oh, yeah, yeah. Thanks for stopping by. So wait, we have, uh, nothing. Justin. Averages of on finally state the password. We have the guests with limited functionality things. So what we could do is it's kind off malleable logic, because if the professor is wrongly throw them to the guest, but, uh, let's let's just just leave it here. I will leave it up to you to try to figure out how toe work around this issue. And if you like this video, give it two thumbs up and subscribe for more. Thank you for watching. 12. Python Bottle Part 12: Hello there. In the previous video, I have shown you how you can use cookies toe change the sides and context suits that special accuser after our education can access. And now I'm going to talk about some kind of security. So basically, in the previous example, the biggest flow was that anyone who is able to modify this okay, that is needed for a specific you can access it. So if you have the person that is other than administrator with a proper password and he says the cookie appropriately, then he or she will be able to access the context route. There should be only accessible to the authoress person. So I'm going to show you work around for this problem. Let's get do it. So we'll call it. Signed cookies? Not be so from battle way. Need to get the post the rope request, and we will have this default trap well. And you was the guy It's called in this and we will have the same board. The corresponding part. Could you support way Have Oh, yeah. So let me still looking inform for you. So if he had hit the focus on the next with a get request. We should get looking Inform that is going toe. Show you the name of the past. Believe that fear than summit. But we're telling text on it. So after we have logged in properly, we could pull out the user name from the request. That ones the best work. Okay, the request forms. Okay, so and here we have some form off authentication, but for the surface it is steak. We will check your user name on the possible course. Uh, yes, miss there. Then we will return every for the Andi. Otherwise, you will return Retired for the day for the next room. If we I have this happening and passwords, user name and password combination. Then we should sat The risk pools is cool. Keep and call it abuse. And the secret is going to be my super cool. No. And we go Oh, I would that God, they're going to be. And boy was that and we was check in the Yeah, eso We get the user from the quest get okay if the icon okay with the secret his proper on leave. We have this year knowing Proceed otherwise clearly. Eyes I eyes in the user name and password We will welcome use on and Oh, yeah, yeah. So that me create? Yeah. And just like to be you. I know I didn't hold us. No for that. Save it. Change to the ball. Well, uh oh, and I forgot them. Talk. So a little football? Oh, the port and keep up. Now it's your drunk. And so we will have case default contestant and lets out authentication change in this context starts. I was wrong. Okay? The name redirect is not defined Fine. And it says that What? I'm not going to the restaurant area from the place video. I'm going toe steal the do it cookie farms and I don't it the oh, no, it doesn't need to be very typical. Said the same cookie. But let's go back and I love you and the bus and it says it's welcome, User to the restaurant. Yeah, and let's just call it that. Yes. Welcome for early. Is that understood? So, basically, this is how you can prevent malicious attempts to temper with cookies or your obligation. At least this is one way to go with it. You could also replace this very simple authentication part with the more sophisticated let's say with secret, back and or and about authentication or whatever you feel like is necessary and appropriate . But the same cooking will make sure that only the Sarah knows what the secret is for that specific. Okay, And even if they said it's cooking, it will calculate some kind of hash and added as a salt. And if that recalculate Tash doesn't match, even if they're using it right, it won't allow the answers to this president's. I'm saying so. Basically, this is what I wanted to show you. If you like this, would you give to subtract all thank you for watching. 13. Python Bottle Part 13: Hello there on come back in this video, I will conclude my Siri's about them, but about Trevor. And I'm going to show you a way to run your application from more. Uh, that said you're a ball on the hard court social. So the basic arguably the before, uh, whatsoever that comes with base is not I have a solution for production. But as you may suspect, from the title of the script, that is a vested on a proper way to run your web application. And it's called the Paste module. So every import face the A C you could sell wrong. So you knew Portal? Oh, oh, we can do. Uh oh, you do not so way say that our application is coming from the battle that default, Uh, and our act has singled you out, and this trout is think Index Functions Association and that this is also running from the A city. The server off the face manure. We have to do it this way. So specified. Yeah, the host and a book. Oh, maybe the real order as truth. And, uh, if I run now this I see following then typos Oh, we Oh, I forgot. So we don't not this trip because if you use the paste as a, then it doesn't need to. Really? Because it will serve the request with different context based applications. So, this way, if we are based, we should get some performance. He proved mats on other Berks off our application and some boosts. So let me know what you think about this kind off Siri's If you like it, even the time's up for No, if you want some other framer or project to really representing to you. Thank you for watching.