 Yes, sir, book form.html we have to create. Yes, we are going to create that now. I'll start sharing my screen, just give me a minute. Can everybody run their Run Server command? In case there's some syntax issue or something, it will give you an error. I will also try to run it and I'll check. I'll share my screen, but you don't need to tell you how to run Run Server command. Sir, can you show your code again? I have one error. I need to check the syntax. Yes, just give me a minute. I need one second to... I'm checking something on the other screen. I need a minute to do that before I... If your Run Server runs properly, at least at the basic level, you don't have any syntax error. I will start sharing my screen again. And while I share my screen, please create a book form.html in the library manager folder inside template. So create book form.html in the same place where books.html exists. And wait for the next instruction. Sir, I have written correctly the line number for 10. I don't know what number you have, but I'm getting the error for define where it is. Sorry, if request.method logically equal to post. So what is the error? Can you paste it? Yeah, I am putting the error. Same error which I had previously. Can you please paste it? Yeah, I have pasted. Yeah, again, this is an indentation error. It is possible that you are... You have not added an indentation after the depth line or maybe you have a tab here and not spaces or there's no indentation after if... There could be multiple cases. But basically... Everything is correct. I will share my screen. One second. Megha, can you please share the complete error and I can tell you what is wrong? Bookforms file under templates under library manager. It should be in the same folder where you have created books.html. Same folder as books.html. Just create the file there. Call it bookform.html. Please make sure spelling is correct. The spelling in your views.py code and your HTML file name should be the same. You can call it whatever you want to call it, but the name should be the same in both places. Otherwise it will throw an error when you are running your run server. I have shared my screen. Can you please maximize? Yeah. This one. The if command is not indented. Same as the way I had written. Is it wrong? Yes. The if should be indented. You need to indent everything under depth. One more four space forward. Everything should go four spaces forward. Now you need to send everything under it also. Like this? Correct. Is it okay now? No. Now your return is too indented. Is it okay? I cannot see that clearly, but in the else block everything should be in the same line. Yeah. They are in the same line. No. They are not. Which one? Your form equals book form and your return is not in the same. Okay. Is it okay now? Now it should be okay. This should not happen I guess. So the L should be backwards. Like in the line of the first if. No, no. It is for the second if. It's for first. It's for first. Okay. You have to get back that form and everything on the column below the column. The funny thing is this will still work. But yeah, you should be able to arrange it properly. Otherwise later you will get confused. Okay. And do it. I'll stop sharing for now. Is it okay now? No. You can compare with the. I share my screen and you can compare. Yeah. Yeah. I can do that. Yeah. Yeah. Correct. Right. The request should be inside. Yes. Okay. So. Because I also tend to not remember the HTML correctly. I already have it here. I'll just. I'll just do some cheating and paste it in my HTML file directly and make some changes. But essentially what we are doing is open book form dot HTML. And once you open book form dot HTML type out the following text, which is a very simple HTML tag followed by a form tag. Followed by method equal to post CSR of token form as stable input type submit value submit. This is the submit button for your form. I'll wait here as well for you to copy this. Please make sure that you're using the correct spelling. Capitalization. Braces. Percentage value. Etc. And let me know once done. So can you show your code? It is available. Yeah. No, no, this one. Views dot pie. The last one. Okay. Let's take it there. Book forms dot HTML code. Well, send you the link. It is the same code. I don't think I have to edit anything. I think I closed it. No, not until not to you. Ananta. Sir at some. Inundation error. This one sir. Two brackets there. Yeah. These brackets are not required. It's all under books. You need. You need square brackets. You need quotes around the names. That is Titan should have open quote close quote. Author name should have open quote close quote. And back it should be square bracket open square bracket close. Yeah. Yeah. Right. So anyone who's finished writing the book form dot HTML. Can you please save. And then we can move to you are. So we fix. We created a view. We created the HTML that ties to the view. We now need to make sure that the URL that we are going to hit is set up and working correctly. So these are the three main elements. Please tell me if you're done with. The HTML page. Most of it is showing the invalid syntax. Most of it is showing the invalid syntax. For the if I change the brackets. For the if I change the brackets. Then there's something else that is going on. And it is happening on a single line initially only. And it is happening on a single line initially only. I'm having a doubt here post that is all lower case or upper case because earlier it was all lower case. In HTML the lower case is fine. In HTML the lower case is fine. All is. Ground brackets sir. The fields. The fields that you mentioned in your previous error. They are supposed to have. They're supposed to have square brackets. Okay. In all books. They're supposed all should have ground brackets. Okay. Stop sharing my screen. If you want to share you can share. Or you can type the issue. No. Excuse me sir. Can you share view. Yes, I'll share it in a minute. Just one second. I can't see what is happening. What does an invalid syntax on some line line 25. Can you show whichever line that is. To. Okay, which line is that. Can you tell me. Context. Yeah, you're missing a comma here. So we are sending them multiple parameters. So request comma. Book form dot HTML. Potation and comma. Context equal to something comma. We need to have comma. Last comma not required I guess. Fine. Abhiji, can you please post your. Error in the chat and I'm. It's pretty. For simple that you can solve it there itself. No need for. Sir, I'm getting on between the name. From an undecided name redirect. Yes. So you need to import book form from. Yes. So you need to import book form from. The forms page. The forms. Five. So like you did from dot model import book. You'll have to do. From dot forms import book form. Book form should use the same capitalization that we use when declaring the class. Similarly, you already have a line on the top that says from Django dot shortcuts import render. You can just add comma to the end. And type in redirect there. So you're importing redirect and render from Django dot shortcuts. My problem is still unsolved. I'm not getting. Yes, share your screen. Yeah. We cannot test out yet because we need to add the. So please wait. Abhiji, you have an error saying line 18 in module, but I can't see there should be more things to that error. You have just pasted one part of it. I can't see the rest of the error. So I don't know what is going wrong. I can only know that something is wrong at line 18. Please paste some lines up until the very end of that error. Can you please can you please use control plus to maximize your text? I can't see. Yeah, I am. Undefined name redirect what we have to do is this one second. I'll paste it in the chat. Which command use itself? Please use control and plus sign button. Yeah. Maximize the text. Eight lines of problem is with the line number eight all books. Book dot objects dot on what is the error. I will show you the error just a moment. This one fields is equal to title author name ISBN number unmarked. This is in the form page. Okay. Yeah, I got it. Thank you, sir. Abhiji for any indentation issues you need to check your indentation make sure it is correct. Make sure your function after your function everything is indented make sure after your if statement everything is indented properly. Make sure that your text is corresponding to your if statement etc etc etc you get the point. For people with redirect not defined I have already put in the chat saying that from Django dot shortcut import render and comma redirect. How to do that? You will have to add it to your views dot py at the very top. Oh, I have done that. Yes, sir. That is just for other folks. But I am getting the error undefined title. Sir, yes, I already told you so you removed the bracket but your names that you use didn't have quotation. Please add quotation to your name. Okay, right. Right. So we now have book form dot estimate. We now have views dot py anyone still stuck? Megha has the error while the run server is running. Can you please copy paste the error that you get? I will share the form dot py file a little later. I will first complete what we are doing. So now go to your url dot py copy paste the line on top paste it on the bottom right so that you have the exact same line. I will share my screen. Yes, I long time no see so I forgot. Sir, I am getting error in class meta. Getting error in class meta. What is the error? Invalid syntax. Invalid syntax. Can you paste those few lines four or five lines in the chat? I will try to understand what is the invalid syntax. So we have you paste it there we will try to see it come back to it afterwards. So in your url dot py file go to line number 22 or whichever line you are on where you had past books. Take that line copy it paste it on the bottom so we now have a duplicate line so we just make quickly changes to it so that we have we have a new url we will call it new book because we are adding a new book we will change the url to new book we can use dot books to use dot what will you call it new book right so use dot new book is a function that I want to trigger I will also give it a name called new book so do that save it basically what you need to be make sure make sure that your url name is properly written make sure that your view dot function name is correct and make sure that the name in the string is correct now if you go to your run server and put in new book put in new book I will check if my server is running it is not so I will run it I will run the server most of the file are directly sorry right my server is running I will hit enter and I will get a very ugly but functional working form now I will come back to the chat and try to solve all the issues for everyone where is the chat so folks need to create a new url point it to the correct use function and please run your server please open the new url in your browser and should work fine please again I do not I think I am repeating this for the 506 time make sure that the spellings are correct indentation is correct syntax is correct etc can you show the url dot ui file again here it is site can't be reached maybe because you are not running the server please check if the server is running for harita maybe it is possible that you have your title, author name etc etc on a new line is that correct is that also happening in your code if it is happening the same way in your code please make it in the same line so fields equal to title, author name etc should be in one line sorry it is in same line fields I have given in the same line okay and you are saying that it is an error so which line is it pointing to pointing to class meta sorry yes my mistake so meta should be capital M that is the error still it is showing the same please save and run your server again okay sir there is an extra underscore urls dot py sorry an extra underscore that is where you can syntax Mr. Kulkarn English hmm yes sir no I did not understand who the person before this was talking to why you talking to me Shreenadee here yes there is a syntax error in the urls dot py of your url file no in urls in mine okay in my url dot py file yeah there is an extra underscore which line can you point me to the last line the new book line 23 I so there is no extra underscore maybe it is looking like that because Shreenadee is rendering that way I mean there is the first part not there the next part before the comma shouldn't there also be an underscore no so you don't need an underscore here because this is the name of the url so I could type for example this could be anything so it could be my book also and that is the name of that url pattern that you want that is the pattern so now new book will not work because it doesn't exist my book will work I don't want you to okay yeah so this will work folks who have reached here please just shout out in the chat and yes or no or whatever people ask me for next steps after book form you need to change the url dot py file create a new url can I share my screen once I will stop sharing and you can share yours I have already put the link to book form html in the chat please scroll up a bit and check I have called it book form dot html and then there is a url you can copy paste the text pretty much simple and everybody people are telling me that they are done can they see the form on their webpage sir error in redirecting so the error is probably that cannot find the name redirect etc please make sure that you imported the correct system how do you import you go to views you add this particular line at the top what is the line the line is in the chat okay sir please paste the error in the chat instead of telling that I have an error please just paste the error and the I have already pasted you have your error here which is I think I thought that got sorted out my mistake where is that fast books views no attribute new yeah yes that is no attribute new okay if you don't mind can you please paste it again I am trying to scroll up to it but somebody always pasted I am putting it again yeah sir I have pasted not books views views.new.book it should be views.new underscore book and please don't use the same url so you already have a url called books please call it something else new book my book something but the first argument which is book slash you already used it once new underscore book okay and where I need to change the url in the line that you pasted you have used books books is a url that you are already using on the top line so your jango will get confused between the two urls if you use the same url name that's all if you have two urls called book slash it will be confusing so call the two different urls two different names so one is book slash one call it new book right one is a books another one is a new book correct in your pasted code it looked like books so I pointed it out that's it now I have made it now new underscore book the third line and just above it books common name is it okay sure so can I share my screen one second I'll just look through a few things that are showing up new book new book new book in valid same time so Shashank you seem to have some problem with your context variable in your views there is one more person who pasted something with a problem in their views somebody wanted to share the screen they can share the screen Abhijeet I guess had an error with unbound local error so he is not assigned the form variable correctly in his views that is a problem what is the error can you please show me the error sir can I share my screen once I didn't understand can you please wait somebody is already sharing so we will not be able to sir it's not recognizing this new book can you go to views new book the name is correct right yes can you run your server and show me your run server page so if that error didn't show up in the terminal then you are fine your text editor VS code is just not able to recognize that because it doesn't understand but it's working fine somebody else wanted to share their screen Abhijeet I'll take your screen share after this can I share my screen for other people who have already been able to see the form please try filling in the form fill all the fields completely and hit submit button it should take you to the page which has the list of books show you an additional new book that you just added please try that and let me know if it works or not what is the error man that is what I am not able to understand so many things are coming here those so many things keep coming unless it says that there is an error you don't have anything to worry about please go to your web browser put in the URL name that you used with the new book okay can you please try that you can try that and let me know Abhijeet you can share your screen now okay sir please show me the terminal with the error new book okay so there is a missing comma please go to your URLs and put in the comma somebody has asked if the workshop is over it is way past schedule technically we did over shoot the schedule a bit but the idea was that you render the form so I will end it for people sort of a little more officially and then I can stay around to solve problems for others so let me see if my form works properly now otherwise everybody I am helping everyone and yeah I am sharing my screen I know I know by now I learned that I am not sharing my screen Abhijeet after second path entry you have to put comma each are comma separated right so that should solve the problem bye bye I will share my screen now right so this is how your form looks it does not look very pretty because we are rendering it with the basic setting but you can actually go if you look at the Django documentation you will find ways on how you can render it properly you can render each field individually also and design it properly in estimates so that they are one after the other etc for now I just for simplicity sake just pushed in the basic estimates where it renders a little more ugly so I will type in a new book name a new book name would be yeah so this is another favorite book that I have from Isaac Asimov Isaac Asimov is the author is the random as the number this is bye bye and this is about the submit and once I hit submit I should see that there is a third book if you go to your admin page you will also see that the third database entry has been added to your admin as well because it is rendering the same database so basically what you have done now is your browser to go to the url my book it sort of shows this text but if I replace it so this is showing up because this is historically what I typed in but basically what it shows is it will show you an empty form again once I enter some data and hit on submit my browser sends a post request data I will try again yes again bye and some text and I am not sure if you can see this but let's see if I can show you how it works in my network tab once I hit submit it will show you that it sent a post request and it got something back which is the redirect request that I came to book so I hit the my book url with a post request and then I got a get request for book which was the redirect right so this is what basically happens when I am submitting a form the browser sends a post request that goes to your Django server Django server then stored it in the database so with the form.save what we did was we saved the book to our database and then the book got rendered when I rendered this page you can play around with that if you want to but yes officially in that sense we have completed one full cycle of what we wanted to do with Django we wanted to create an interactive web application create a form create the database create some basic business logic and about done that you can do some exercises like you can create the form for member also on your own and try it out you can add more models if you want to you can add more fancier html and try to edit the html and see how it renders those are some things that you can try on your own but otherwise in general we are done for the date as such and I can stay around for let's say 20 to 30 more minutes and help out the 12 who are facing issues so in case everything is working fine for you this is about the end of the day and you don't have anything else to do that is new so if you wish to leave for the day you can leave for folks who are facing problems you can stay back and we can help you with the issues I'll stop sharing now yes sir mine I don't think it's coming you can share this on screen once again yes Pratame can you just help her out and I will come back in a minute the server is running so what what issue for now and I should check the server right the web browser here I should go to I think it's not digital or type local I should type local host all on 8000 new right right local host not able to see your web browser okay you have entered space as an underscore okay in the template template as you have written form.as table as underscore you have entered a space that is why in template new book dot html the html template new book I should create another new book say html there I should do this one you have already created new book right html there is another html template right that is I will go there as underscore table you have created a space over there as is after as yeah and your form name is n form no it is minus okay you can save that and now it should work okay sir I will stop sharing sir hello yeah let me use it on this local host 8000 only I am able to see the books if I go to the books no not the list I don't know where the problem is oh okay yeah sure yeah is it visible sir yes yes okay can you go to your views yeah just a moment have you already added the data like I recommended last time yeah just I will show that also this is the view file sir okay alright and I am saying the data yeah why I need to go to the admins then where I need to add the data to books there is no book model itself no it is not showing yeah you have to register book model in the admin.py then it will show up over here then you can add and then just a minute yeah copy that line yeah this one and paste it into book instead of member book okay be capital yes yes not like this only book okay much is required only yeah this much yeah it will work anyone else sir if I am entering some data in the form automatically it will get no save button or anything no submit is there no you will have to submit I would like to share nice things yeah sure yes I just know such column for author name so you can show your model not you don't have an author name column so don't use that anyway yeah it is not this there is book author show your forms can you show your forms yeah models models start here so yeah can you show the error again maybe she added later and so I rerun the yeah you need to close the server can you run python manage.py make migrations oh you rename something to something no that is why the data shows up was book author yes was lsbn yes right now you have to run migrate python manage.py migrate so general query is the modules on yes should be available for about a week or two more you can refer to those about certification unfortunately we are not aware mega can share as soon as she wants to I guess she is sharing okay in this case in this case I made manually this input just take the value right but you will have to add all the fields because what will happen is when your new function gets all your data it can only contain name and author so for your other fields will be empty and in your model it will throw an error which is why we were using the as table you can take some time to do this it will take some time in the sense that you will have to add all the fields you will have to make sure that all the fields are getting passed to your new function correctly etc you also have to add the CSR token in this case also your CSR token should be present always you can try that as an assignment at home if you want to you need to make sure that everything all the fields are present because in your models all the fields are mandatory so even if you open your admin.py in your admin.py if you don't enter one field it will start crying that you left this field empty this is why all fields are empty yeah right can we let's share a screen please you can share your screen and you can tell me the error template does not exist is the problem now it shows up okay I am guessing I solved anyone else facing issues you can I am getting the form now but submit option is not coming that's the last problem then your html may be a little different or incorrect please check they are ready to give input type submit and then value equal to submit you pasted the html file in the chat you can check there I pasted it in the wrong page here it is it is not going because there is something other than that error that is showing up either while adjusting your original indentation error something else is going wrong you should always check the line number of the error traced by that shows up if you are changing something please check which line number it is showing up on try to fix it yourself and then we will see so I think Dr. Kulkarni also wanted to share something I just wanted to know actually we did not get time to go through the videos some videos we saw from the day one but today we did not get time to the videos will be available about that thank you sir I thought that today we will close the link thank you sir yes sir within the mean period time if you want to go through all the modules of your Django and Python content if you do not get that time period to have a view of this videos what yaks has so is there any other portal where IIT has posted these all videos on youtube where the links are there which is coming from youtube can you coming I will check and tell you because if yaks portal is closed within a week or so we will not be able to at least view and get referrals from the content also that the portal is very good so that if we can have that for at least a month or so that would be great but it would not be that one weeks time would not be sufficient to go through everything thoroughly yes yes we also have other tasks at our hand so I mean we cannot devote entire week to this particular tasks only sir I am sorry it is not still coming can I show my screen one second okay should I show the HTML code sir this is how it is coming yes this is the HTML code what is the issue when I am going to the phone that submit button is not coming I will show you the can you remove the part on top the part that is showing up on top just remove that when I am opening a new file that is okay just remove it now and save it should I break and then again do no no no just refresh the web page it is still not correct right no that submit as an option it is not coming can you show me the HTML again and please click control plus I think we can maximize to see what is going on and method post use double brackets there use double brackets on csrf token no that is correct just remove the space between percentage and curly braces that is one I don't think that is one problem but form method post wait one second let me check form method post nice form input type should work please save and just try again input type hasn't closed I think input type input type no input type don't need close still not working sorry I didn't notice the page no I think it is not working no so now we got rid of the csrf token can you remove the space between your arrow and input arrow and input yes thank you sir it is coming no most probably you do not import form in your file please import it for us in the thing is he is saying that the browser or the admin page is not getting updated please refresh the page or please make sure that your run server is running in our terminal go back to your admin and please press refresh thank you for attending it was great to have you just ask one doubt suppose here we have learned library management system if I want to do something suppose railway booking system or something so where how we will get help from designer as a common user when I am not under process then only your database design will change some of your forms will change your urs may be different for example let's say you are doing a railway booking system you need a form to submit your request you need a model to store all your train you need some scheduling sort of model to store your schedule so it will be a little more complex than this but it is the same basic concepts that you need on top of them to sort of allow you to store the data I should do the modification in this library management system I should do that because that will be completely different that will not be simply similar to this we will have different tables different database you need different url so already something is there in Zangu which I will be able to use like here how I am using library management but I have to start from scratch no so like you did in this case you will create a new app called train ticket booking system you create a new project you will create a new app you will add new models so same process you will follow but you will do it little differently because you want to store different information ok sir hello sir yes am I audible? I am not able to find out my form where to fill it I tried it several times so url not py did you fill in yeah just I am showing you in url file yeah it is filled I am showing you yeah there is some other problem see is my screen visible sir yes sir yeah so I told you first that you have two url called books yeah those I have yeah those I have but you can't call the same url books no you have books for one you have books for the second one also both are called books yeah this is the problem yeah so what I need to write here new books just write any other name then please show me your server so open this url in your browser and then show me your server page yeah I will do it one more time no it is showing error but sir you typed something different in url.py sir your name there was something else ok capital new yes sir no still showing the error that is still error change that is good news no now you have template does not exist so you need to copy paste this template which I am pasting in the chat yeah so this one HATP no the link that I gave please copy the contents into new underscore book dot html which html file did you add new dot py just in a time frame is it visible sir what is the name book form dot html right please create a book form dot html in the same folder where book dot html was created no I did not understand you have a folder where book dot html was already created can you please open that folder yeah in library manager same folder we were there only now create a new file here called book what is that name go back to the view dot py forget the name also yeah it is called book form dot html just create that in that folder and copy that content of that link that I gave you it should be text file no it should be html file okay I will do one thing yeah just save this as a here only library manager correct no no no no no no go into templates go into library manager again go library manager template library manager again now here you will save it as library manager dot html and save it as an html file yeah save it okay please paste the content of that link that I sent you I will send it again if you want me to yeah just a moment where is that link in the chat in the chat yeah yeah this one it has to be open save it hmm refresh that page in the browser which you have got error no I have to go to the server first no no it is already running okay go to the press enter again so it is showing submit but it is not showing the form can you please show me your views dot py yeah view dot py has form request context form dot save can you show me your template again please yeah can you open it here only no problem why is it showing up like this oh you opened it in the browser that is it can you open it in spider only yeah yeah I will open it in spider template form dot as stable I can't see the text html form psrf token form as stable can you show your view dot py again yeah can you refresh the html page again sorry on the browser I don't understand why this is going wrong no idea also shall I refresh it can you please refresh the browser page yeah no it has to be new form no new book is correct new book is correct yes I don't know if it is correct yeah yeah you have idea why this is happening uh we have new error also wait book form doesn't take argument can you please press refresh again yeah this will be something in views yeah but okay go to form dot py maybe form dot py something book form yes book form should open bracket model form close bracket where where sir line number 5 open bracket okay hmm model form that you see on line number 1 please add same spelling there in same model form on line number 1 that you see please add that into that bracket wait I will paste the line completely for you I will do that in book form I will paste it so you can compare with the chat line class book form model form in bracket yeah book form model form in bracket correct now save it and now you can refresh your web page and it should show no just now it is showing you can enter everything and submit it I think with that on a good note we can end the session here so thank you for cooperating it was interesting to sort of help you folks figure out Django I hope you had a good learning session sorry for over shooting the time but I hope you had a good time thank you so much the folks at e studio can you please stop recording and you can also stop the room session for now yeah one second Shruti has some issue we will just see it once and then we will stop it what was it? who was it? Shruti Shruti wants to share yes some issue maybe your Shruti or someone whoever yeah books are not showing up can you go to open your template template template file books.html for my book in all books my book have you entered the data in your admin page was the books already entered not this add books to your admin page no one second the spelling missed in template yeah then you didn't add anything in admin please open your admin interface add some books and then they will show up here you don't have anything in your database then nothing will show up here yeah go to admin no color slash admin no no no on the web browser save this file save that admins.pva it's not saved yeah not running your server not running your server books are not defined boss boss it is not saved no admin.py please save file in your text editor please save save control s save yes now refresh now refresh the web browser run the server yes stopped it run the server first in the terminal now once you are running now refresh the page now go to books it is there so show your views.py in your text editor so this is all books all books all books book.object.all give me hand give me hand show me your template again can you maximize your window lots of space books.html okay so that same books.html can you please open your text editor for my book in all books my book li and 4 you should show up no yes i think it will show up please refresh that url again not this one the books last book enter enter yes good thank you sir yeah thanks i think you can start