 Just before the lunch, we successfully created a first view. So that is very nice, actually. So the flow was, in views, we created a view named books. And we simply written a simple HTTP response. Basically, it will be a web page. So we all know we can also write HTML in it. And this should also work. So a list of changing it. So we understand we have changed it. And if I save it and then come back to the terminal, I need to obviously run the server. In development, we always keep the server running at the back end. That is also one way. So every time, we don't need to run it. But since we are learning it, we are every time running the server and then proceeding. If I go here, if I see a list of my books, H1 is also applied HTML. So basically, what we can do is we can write the HTML over here. But again, in the presentation, I told you all that Django provides you with the segregation of all your views, model, and template. So it is definitely not a good practice to write your HTML over here. So we will be creating a separate HTML template and we'll call it over here. So this is our next task to create an HTML template. And I'm sure you all will like it because everyone is quite comfortable with HTML. So let's come back up my server. And now, OK, before that, let me check chat. All good. OK. All right, nothing much related to this. So fine. So what we'll do, where am I? I'm in my project directory. I'll go in my app directory. So what is my app? Library Manager. So CD, everyone CD in this library manager. Get into the library manager. Obviously, you'll see your views, models, and everything. Yes. Can I get a response? Yes. Yes. Nice. OK, here we are going to make a couple of directories. So the command I'll use to make directories MI, MKDIR, make directory, space, hyphen p. OK, I'll tell you what is this hyphen p. Templates, backslash, the project name, library underscore manager. So make MKDIR, space, hyphen p, templates, backslash, library. So in your app folder, that is library manager, everyone in their app folder, library manager? Yes, sir. Yes, sir. Over there, we have to create some directories. So I'm using MKDIR, hyphen p, space, templates, slash library manager. OK, so this you have to execute. This command, press Enter. Did you hear me what I said related to this hyphen p? No, sir. OK, so basically, hyphen p option will create the parent directory also, because templates is not present in your app, library manager. It will create this. Then it will create this folder also. Again, using command is not necessary. You can go to your project app, library manager, Explorer, Windows Explorer, any. And you can then create a new folder, name templates. And inside templates, you can create one more folder, library manager. That is also the option. This is faster. So command is always faster. So we should always try to use it. Sir, if we make a direct, we will make a parent folder. So we are now same report, but that is the important thing. You may create it from the Explorer also directly, not an issue. So once you have executed this command, and if you do DIR, you will see a templates directly in your app library manager. Everyone can see templates, DIR, directly in your app. Yes, sir. Yes, OK, well, no errors, no issues. This time that is great news. Let me check. OK, all right. As long as it's not there, this is showing in. I think maybe you are. This is not recognized as you don't, you have to do CD. This is not a command. This is a direct, you know, well, OK, fine, I'll come back. OK, so all can see templates. Then what you can do is you can go inside the templates. What you will see is magic happened, and you do DIR. You will see library manager created folder inside it. This is inside your templates, OK? So the command created two folders, one is templates. We're inside the templates, library manager, OK? We'll go inside this library manager, OK? And over here, we'll create HTML. So notepad.exe.html. This template we'll use for our views, that is, the books view that we have created. So I'll press Enter. Yeah, it will say, cannot find books. So do you want to create a new file? Yes, you want to create a new file. Everyone can reach this point. Once they reach, let me know. So I'm inside the templates library. You can see my path. So basically, we have to go to template library manager. Then after creating. In templates, you have created one more library manager over there. Yeah, Maasum, you need to check your path. There is no library manager, it is same. You need to do DIR. There will be library management. Inside that, there will be library manager one. And we check it properly. OK, let's come back. So yeah, so every majority of you all got to this point. Can you paste that path in the chat? I'm pretty sure that there will be a lot of confusion. People see it should work. Yeah, it's working. This is the path. When you enter your MyJango project, there is your library management, which is your project that you have created. Then there is the app library manager. Inside the app, you're creating templates. And then one more folder, library manager. Maasum, you have to get into your project. It is mentioned over here. OK, so I've posted it. Yeah, anyone who reached this point where they can open create a books.html? Yes, sir. Yes. OK. So I'm proceeding. Can you guys like? Sir, come on for Linux. For Linux also. OK, for Linux, Notepad won't bug. If you use any text editor, you can open like. There is Vim or VIR. Notepad will not be there in Linux. MKDIR, like in Avalu. Like TouchBooks, Dotastream, and so on and so forth. Touch will create it, but you need to edit it. So you will have to open it somewhere. Right? Touchtube will create books.html, right? OK, sir. You need to open it in the editor. You can go to the explorer double click. As long as you can even open your file explorer and create the folders one by one. As long as you keep the same order of folder, it is fine. Yeah, the order is the important thing because Django looks for templates by default. We don't need to mention it to Django. It will look in your apps for this folder templates. So it automatically will get your templates. So that is why the structure we are following. Along with the order, the names have to be same as well. The names can be changed. Names also, templates name is also keep it templates only. You shouldn't change. In library manager, we can't change it. Definitely not compulsory. But we are keeping it same as the app name just to keep it in sync. So that's the only thing, yeah. Because sometimes we need to modify the admin app, which has its own templates. So over here in templates, I can create one more folder admin, and I can have, I can override the template, admin template, the design. So that is why we always tend to give the app name inside the templates. One more folder. So all these templates belong to this particular app. That is the intention. So not compulsory, but that is how we segregate. Yeah, looks are there, cannot be open, sir. Yeah, you create it. It cannot be open, so create a new one message will be there, click on it, yes. OK, so I have books.html. I am sure majority of you all are very comfortable, like extremely comfortable with HTML. So I'll just write HTML. This is free, OK? Like you can do whatever you want, you can do over here. It's not like exactly what I do, because whatever you do, it will be displayed on the web page. So it is, OK. For now, I guess, if you follow along, it will be better. OK, yeah, I think it is right here. So list of books, OK, I'll just write one, maybe math, mathematics, something I have written. This is just to give you an idea of how we separate out templates, how we link it to the views. That is the basic idea. So once you create it, save it. This should not be exactly what I write, but you may follow it. This is just an HTML template that will be displayed. Let me know, yes, no, once, OK, you are done. Yes, sir. Actually, I guess I have an invitation error or something, like NKDIR, then do we have space and then hyphenp? Yeah, yeah, space, yeah, NKDIR is written on here. NKDIR, space, hyphenp, etc. Yeah, NKDIR, write in the command, in the chat, yeah. Yeah, create, we have to create. It is not already present, so we need to create books.html. OK, anyone else? OK, yeah, Ankita has given the question. Yeah, it's recording and all, OK, this question can be asked at the end, I think, not during the session that is actually writing the link right now. OK, so, OK, everyone, OK, I'll wait for a minute. And I guess, ma'am, please let me know if you have finished. Sir, not done HTML for a long time. What does BR stand for? A new line, we have to break, like, get to a new line. It will, yeah, simply give you a new line. We need not have a closing tag for that. Sorry, we did not have one. There was no closing tag of BR over here, no? Yeah, it's an individual tag. OK. So there is no closing for here. There are a few tags which have no closing tags. Even input, it's the same company, right? Yeah, so here, you need to create books.html file and write this code in that. You need to create an HTML, then, OK. Done, sir. All right. OK, let's move ahead. Yeah, you can do manually or you can use notepad.exe, space, books.html. It will create for you if it is not existing. Yeah, creating file, you can do it manually. You can do using command, creating folders. It's your choice, that is fine. OK, so, yeah, let's move ahead. Yeah? Yes. OK, yeah, we got, yes, a few more of y'all can respond. Yes, sir. Yeah, great. OK, so, yeah, we have the HTML. Now we need to just tell of use that use this template, HTML template. So now we are going to use the already provided Django shortcuts. This was already there, render. So render will basically take your HTML, and it will just give the response. So now we are going to change this command. Instead of this, we will be using render. The purpose of showing HTTP response is that you get an idea of what exactly how the flow is, what is happening. But render is the shortcut. We always take the long cut before we study the shortcut or we find the shortcut. So that was the purpose. So now render will pass. There are three arguments that will pass. The number one is the request object itself to give information about the request and accordingly process the response. Second, we need to give a template name. So our template kata, OK, that name we need to give it over here. So in quotes, our template is located where, sorry, library manager slash, what was the name, books.html. This is a template name, so we need to get it. We are passing library manager also path because in templates, we have created one more folder that is library manager. So that is why we need to give this information. So what Django does is when the view, basically, this view is rendering in a little one second. Yeah, all of that. So what happens is when this view is called, OK, basically, it will process your request, OK, and whatever logic you have written over here, then it will call this template, books.html. But why it comes to know that your template is over here? Because you have created one folder, if you remember inside of F templates. So by default, it looks inside the templates, OK. Even if you look at settings, that is OK. You can change the path. In settings, I have settings open. Yeah, I have. OK, if you look at settings, we can also play with the templates. We can mention the directories. And here, it is app-directed room. And it will, by default, look into your app-directed template folder. So we don't have to worry. That is why the name is so important, templates. And this, whatever name you give, you have to mention over here, books.html. And last thing is, if you want to pass any information to your template, because you need to keep your templates dynamic, right now, I've created a static HTML. If I want to create it dynamic, every time, OK. So for example, someone logs in. So it should say, hi, Rahul, hi, John, like that. It should not always say, hi, user, hi, user to everyone. It's a static thing. So to make it dynamic, we need to pass some information in the form of dictionary. We'll keep it empty right now, OK. Nothing I'm passing. We'll see that later. First, let's understand this. So kindly change your code to this, OK. So it is the same view file, which we did before lunch session. Same, same, yeah. And you need to save it. Same thing it is. OK. Sir, if you just, second line, now, its requirement will be there, right? Yeah, yeah. The last line that you had written, HTTP response. In place of that, you have to use now. We'll use the shortcut render function. The second line in this file, second line, which we are importing, HTTP response. If we need that line still. Hey, the import, you can HTTP response, you can delete it. We are not using it, but it's fine. We can do that later. OK. OK, sir. Yeah, that is, if you can, if you're not using, we can remove it. But if it is there, no harm. OK, OK, sir. For now, yeah. Sir, is there any indentation while writing the path name, the single quotation, or the quotation? No, for Python only, there's no, after the function, whatever the body, you need to put indentation. Otherwise, this is not much. I put space because it looks good. So if you don't put it, you'll find out. OK. OK. Done? Yes, sir. OK, wow. No, template is not. Oh, it's not there. CD space template should be present. So, again, you need to create it then if it is not present. Check DIR. Now you must be familiar with it, checking whether it is there, not there, created. OK, others. How is it done with this views? Hello, sir. Yeah, yeah. So this is how I did make DIR space slash template slash library manager. I did DIR then it is not showing it is showing admin.py, apps.py, migrations. Modules.py, it's not showing templates. You did it in library manager itself, right? Yes, sir. Within library manager itself, you need mkdi or hyphenpy. mkdi space hyphenpy space templates slash library manager, correct? Yes, sir. It did not show any error. It executed well, correct? Yes, sir. It did not show any error. So, and if you do DIR, you don't see templates? No, sir. It is not visible. I did a slash before it. Is that allowed? Yeah, don't know. Simple templates, no backslash. Oh, have put mkdi, hyphenpy, then slash templates have put. No slash, remove that slash. It may have created some other location. No slash before templates. My mistake, sorry. Templates. Did showing subdirector or file hyphenpy already exist? Subdirector, hyphenpy. Sir, this is the same issue with mine also. Start with the directories. Can you open it in your windows explorer? Just delete any extra directories that you can find and create one manually. Just right click new folder, go inside, right click new folder, that also works. You don't have to do it through command line only. So, what I'll do is I'll proceed ahead. I'm about to just complete with this. So, maybe we'll have a short, maybe 5-10 minutes break before the next session in which I'll just rectify any doubts, okay? So, because I think majority of you all have completed this thing, correct? Yes, sir. Next, what we need to do is we need to run server. Be careful when you try to run server, you should be back to your main directory where your python.py is there. So, I am now in library underscore management. If you want to move back, you know the command now, cd space double dot. Okay. And yeah. So, once you are there, let me run the command. Python, it will be there. Yeah. Python space manage dot py run server. Yeah. It is running. And once you are done, you can shift to your web browser and just reroute it and you will see the change. So, it has taken your template. It has rendered your templates. So, that is so nice. We can segregate our templates, our logic, and then the models, the database will be separate. That is models that you will shortly see how it happens. So, all of you, okay, can follow this. No, sir. Error. Who is this? Who got error? What error? Suraj, you got it nice. Okay. Yeah. What error you got? Template does not exist at books. There is no templates at books. So, maybe you have given some wrong path in views. Check whether this is proper. In my case, the same old list of books is coming. Mathematics is not coming. So, maybe, I hope you have edited the right file. Maybe I have. Yeah. It is a check through command, like command from notepad.exe. Last time, I think we had a different file. Yeah. Yeah. Check that, yeah. Yeah. In the parent directory, that will be managed. Yeah. In library management, the main folder. That will be managed. Okay. Sir, same view file may be changed. Yeah. The library underscore manager. Slash bookstore HTML. Okay. Okay. Yeah. Can you quickly share your screen? I will stop mine because I think this output is the important thing. What is this? I think quite a thing you have understood. Okay. I think the slash should be backslash. All the front is fine. Yeah, fine. It is fine. It is fine. It is fine. Okay. Can you go to your terminal? Yes, sir. It's visible, sir. Yeah. Now it's visible. Yeah. See and just stop the server. Okay. Yeah. Can you do DIR? Okay. Yeah. Then CD library manager. Go to library manager. Don't press enter. Okay. Yeah. Small eye. Yeah. Okay. Fine. Manager. Manager. One more time. Okay. No, no, no, no. CD space dot dot. You press enter. I said not to price dot dot. Okay. Okay. Yeah, no problem. Yeah. Now CD space. CD space. App name, library manager. Okay. Backslash. Okay. Can you press enter? Fine. It's okay. No problem now. No, no, no. Now clear this CD space. Oh, do DIR over here first. Let's check what is in this. Clean. Just go back. Did it this? Yeah. Yeah. DIR. So templates is that can you do CD templates? Check what is in templates? Yeah. Do DIR. Yeah. Very nice. Okay. You have library underscore manager. Yeah. Can you do CD in that library manager? No. Tab will help you. Okay. Okay. Can you do a DIR? Okay. You have books.html. So yeah, your path is absolutely fine. Not an issue. Yeah. Can you show once again the views? Yes, sir. Yeah. What about others? Did they? Sir, my attribute error. Okay. Okay. There is a space I think between the quote single quote library. Yeah. Check that at the start. It says. No, no, no. Remove it. No, no, no, no. Backspace. Backspace bar. Backspace. Press. Press. Okay. Okay. Yeah. Save. Okay. Yeah. Okay. Okay. Yeah. Okay. Yeah. Anyone else? No one? Someone was saying right now. Yes, sir. Sir, my also getting attribute error. Yeah. Can you share screen quickly? This is. Can you show views? Yeah. This is fine. This is happening right now after changing this or it was there. Yes, sir. This is happening now. Okay. Yeah. You have not put render. So return then the render. Yeah. We need to use render function. Yeah. Before parenthesis. It's a name. Sir, I'm not writing. Okay. I'll send you on the chat. Sir, the meaning of random render function is to get the content and style from particular file. Yeah. Yeah. So render basically will take all the things like it will obviously create a HTTP response for you. And it will. Okay. Also gather your HTML template. And if one more thing I'll show you right now what one additional thing the dynamic thing that we can do. And it basically renders the HTML template that you create. So that is why we have this render. So this is fine. Return. Return it. Oh, at the start return return. I didn't write. Okay. Because I thought. Yeah. Return render. Return space render. Space render. Yeah. Is it? Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Now this will work well. Okay. Anyone else? All done. Okay. So, yeah, you can stop the screen share. I'll share mine. So all like got the output list of books. I didn't get it. I only got list of books. List of books. Mathematics. Mathematics. Yeah. It should basically be your HTML what you have written. So yes. Yes. We didn't get it. Yes. I didn't get it. Okay. Okay. Okay. Okay. Okay. Okay. Okay. Okay. Okay. Okay. Okay. Okay. Yeah. Yeah. Yeah. Yeah. Yeah. Okay. Okay. Yeah. Yeah. Yes. You can share this. Yeah. So still on dumplings. Yeah. Yeah. Can you show? your browser. Okay. You're getting list of books. Okay. Can you show views dot py? Can you stop the server and? Your control see. And notepad over there. You can open it. close this for now close close not many nice yeah from here you open no the views notepad.exe okay fine fine notepad.exe you can type it for now space library manager it's inside the app no text slash and views yeah that's it sir dot p1 tap tap do tap to autocomplete it will help you yeah enter yeah see you have not modified your code no so yeah will it work it will not work modifying the different file so be careful check the yeah directly path and all okay all right so fine have even I think most of you all got it right you can stop your screen share yeah Shwini okay so yeah can you can I get a response like uh uh yes sir yeah why uh what is this okay most okay done what is happening no see uh you had created first I previously I checked it was management one now it's management so that's highly path issue okay we'll check it later uh one second I'll just uh uh yeah so what is the issue yeah can you save uh like they are saying that the file like this template file already exists so I'm unable to create a template and restore the things so check dir you check what is inside it yeah the template is already there so it will obviously give you that message it's already there so it will not create again so that is why so you already have this yeah so can I start with this note part yeah you should have so what what uh you have to yeah what means what exactly now you'll be doing I'll be adding the html code view in this so that you can yeah yeah that uh that you can uh I'll share the code uh I'll just wrap it up uh with uh things yeah you can then we can see you're not an issue okay because I think uh majority of you all have finished it uh correct uh yeah yes sir yeah yeah so okay one last thing uh there's a I think uh you can see my screen yes yeah so now I was talking about uh the dynamic thing like uh right now I have uh the static thing so what I can do is I can define a dictionary okay uh basically I can give any name and I'll call it in context or even if I directly pass dictionary over here it is fine so what I'm doing see everyone knows how to create a dictionary in Python right so I'll call book one I'll call it math then I'll uh have book two okay one second yeah uh book two uh I'll call it maybe uh Python all right uh let's save this so basically now I'm passing some information a dictionary uh obviously uh to use it in my html template let's come back now how do I uh use that as we use a templating language uh I mean to say engine that is ginga template uh templating engine so I hope most of you are familiar with it if not then for now I'll just give you a simple thing so what uh if I want to show a variable from the dictionary I want to print it on my html so I use uh two curly brackets uh start and go closed inside this I'll just pass the dictionary uh okay that I've created obviously uh the name so I have book one if I if I type this book one it will automatically uh okay take this value math okay so okay everyone knows our dictionary right it has key and value pairing right so book one has the value map book two python so if I want uh this to be displayed okay I'll again uh use curly brackets and I'll pass now I'll think book two so book two is what uh obviously Python so this is how we okay dynamically okay render the html page this is just a start uh obviously uh you know we'll have to go through various okay like a lot of things are present in it so you'll see that okay so now save it uh and you can save this also and go back uh to the runs away it will automatically get updated and I'll show the steps again don't don't worry and if I okay I see uh okay math and Python so it's uh it's getting okay uh what do you say rendered properly so basically what is the intention over here is if I uh have a database query I get the books and I pass that okay to this html so every time the data will be dynamic it won't be static that initially we created so this is uh okay how okay we can basically have a dynamic rendering of a html page so yeah so this is a view so can you instead of okay passing empty dictionary you can pass this simple okay create a dictionary you can create the way you want not necessary what I have written but see to it it is the dictionary you have a proper key okay which because the key you have to okay pass it in your html within this okay to curly brackets okay so you're done uh okay I'll switch to the html for your template or bookstore html oh done wow Ayush has completed anyone else sir done yes sir done yeah and then you can check your uh web browser it should uh the web page should get updated yes oh wow I'm quite happy to see many of wow nice nice sir we can uh use uh heading tags with the dictionary also no yeah yeah you can use uh in html you can use anything yeah you can give uh I can give tab uh tags uh like uh whatever I want okay so maybe I can create a list also no unordered list right uh so you will I'll create an ordered list so I don't need to write uh the br so this is just okay who wants to like html they are why this is a insert second I think I pressed insert okay so basically uh li I think I have pressed once again yeah it's fixed okay so li uh list item and I don't need br so uh html uh you are free to do the way you want so there is obviously everywhere uh you're free to use whatever name you want the dictionary you want to pass it's all okay like our choice this is just uh you all to understand how the flow is what exactly is happening so this should also work if I save it uh the server should track the change it has tracked I guess if not we'll find it in the list it takes the unordered list yeah uh then you can start playing along around with it uh what if I do ordered list and save it and come back and refresh it one two that's fine so many things can happen so html uh if you're good in html uh you don't have to worry about the templates you need to only understand uh the ginger template engine thing that is how this there are many more things to learn a rule right now I'm uh re typing it you also have for loop to create the these tags so those other things should be focused yeah uh I need to make one uh clarification when we were doing some commands on command prompt yeah so I told you uh to create a directory vf mkdir uh like directory it will work in both Linux and windows uh and I had this hyphen p option and then uh some name like maybe templates uh slash and maybe okay some another directory my whatever so uh I just want to clarify one thing in windows uh if you don't use hyphen p it is fine it is not required it is only for Linux okay where uh it is necessary to uh create okay uh like parent directory as well we need hyphen p in windows it will work okay without hyphen p also in fact if I give hyphen hyphen p it will create hyphen p directory so it will take this also as a directory so if I want to create multiple directories uh in a given directly I can say a b c and it will create those directory so to give you a demo uh still since it's a break so mkdir uh I'll create uh ddd just I'll delete it later I'll go to that triple d and I'm inside this inside this there is nothing it's empty if I do mkdir a space b space c space b and uh presenter I'll get uh four directories okay and uh if I do mkdir uh some okay uh suppose temp slash um uh something my okay it will work well and it will show you temp created cd temp and inside temp it will again show me this okay my directory as well so so hyphen p only for linux user not for windows that is the only clarification I wanted to make so yeah fine uh all right uh so I hope uh you understood things related to uh jango web framework virtual environment and uh the flow of the jango basically the mbt model design pattern models views templates models yeah and it will uh okay uh take it uh but I hope you understood how the views URLs are configured and uh how we okay link it with the template the template rendering yeah yeah okay uh so uh thank you so much uh yeah I'll hand over to Ankit thank you thank you thank you thank you so much for your patience and yeah yeah it's fine thank you