 So I am right now in my library management application where the manage.py file is. Since you already have some idea of navigating, I'll leave the navigation up to you. But whenever I mention that you need to be in the folder with manage.py, this is the folder that I'm talking about, the topmost folder. In case, so I noticed that a lot of folks still had issues with navigation. So command line navigation is generally new to folks with GUI, a habit of using the GUI. I'd recommend that, you know, the idea here is to start learning the whole Django concept. So it is obviously difficult to pick up on the command line side of things. So please feel free to just open up your, like your Windows Explorer, and then start using, you know, start navigating from there. It's not like we don't want you to be struggling with the command line just because we want you to use the command line. All right, let me see. I am now set up. Cool. So step two will be, so what I'll do is I will launch my Anaconda Navigator and use spider for my purpose. So Anaconda Navigator, you don't have to do this. If you have sort of found that notepad, EXE works well for you. Perfectly fine, just use your Windows Explorer and notepad. I'll give it a minute for Anaconda to sort of boot up. So what are we gonna do next? We are going to build the models. So as you already are aware, the models.py file is located in your library manager folder. Please go to your library manager folder and open the models.py file. Let's see, where is spider? Jupyter lab is also quite good to use, but again, completely up to you. Okay, so spider, it looks like it's decided not to... Ah, cool. I was afraid that it was decided not to cooperate, but anyway. So I will open up the models.py file in my editor, which is spider in this case. Go open, go back, everything will take so long. So my models.py file is located here and I've opened that. And like your views.py file, your models.py file is also empty. What you need to do here is if any of you have gone through the, if any of you have gone through the oops, concepts in yuck, you'll know that this is how we define a class. A class is defined as a book. We inherit from a base class called models.model. So I'll create a class called book, which is going to be a class that inherits from models.model.base class. And I will now define attributes or variables. So I'll define very basic variables like title. I will then define, I'll then define a model method called carefeed and give it an argument called max length. And I'll tell you what this means. This is a capital L, yes. Character field. Carefeed, yes. So what can be relevant to a book? Let's say a title is relevant and author is also relevant. So let's say author name, publisher. Again, I'll give it a max length of 255. You can give it a little less, but I think so the max is around this number. And then we'll give it something like a text field for say description. So the description will carry a summary of what the book is about. And this will be a text field type. So we have our first model setup. We've imported the models base module. We've then created a class called book. And then we've defined certain attributes. Now, if you remember, we spoke about how the models was a representation of your database and we use an object relational mapper. So your book object or your book class is what maps to a table in your database, which is why we're using a backend system called an object relational mapper. So it is mapping your Python class to a table in your database, right? The ORM works in the background, so you don't need to worry about that. What you need to worry about is how you define your classes and how you define your tables. You define them by creating a class and each class being a table, what do you think title, author name, and descriptions refer to in SQL language? What would these be? If book is a table, what is the title, author name, and description? In an SQL table, what would they be? No, fine, no problem. So in SQL, these would be the columns, right? An SQL table is a tab data format. So if you have a table, a table should contain columns and the columns describe properties of every row. So you have multiple rows of data. Each will have a title, author name, and a description, right? Yeah, so with this done, again, you remember we spoke about migration. So we will go back. We'll save this file, obviously. We will then go back to the command line. And again, like I said, if you can see my screen properly. Sir, please. Like I said. Those being models.py. Okay, okay. Have a look. I'll wait for a moment. Let's do one thing. I'll paste this in chat. This is your complete models.py file. I'll paste it here. I hope that works. Though copy pasting has a really bad disadvantage is that you'll have to manage the spaces and the tabs yourself. So please be careful. If anything is going wrong, make sure that your spaces, tabs are correctly set. I think you can just pick up the code from the chat. I pasted it there. So going back to the command line, I am in the folder that contains manage.py. Why? Because I'm going to run a manage.py command. I'll run a command called python. I just, the command is python space manage.py space. Make migration, right? So what you've done is you've created a model. Because you've created a fresh model, the migration file that tells the database to do some change to itself or the schema does not yet exist. To bring it into existence, you will have to run this command called make migration. So please copy this command into your command line. And once you save your model.py file, you can execute this. Please execute it and wait. Do not ask for why this output looks this way. I'll show you what the output looks like. In the meantime, has everyone reached this point where they've copy pasted the model.py code and can execute the make migration part of the command line command. Any issues still here? Not able to copy the code, okay? I don't know why, but I cannot, I'm not sure how I can help you. You can go into chat settings and check whether we have access or not. Check out the settings part white. It's not like I have a lot of access here in it, but video, video, general video, nine part sequence. What was the command manage.py make migration? Make migrations. I've also pasted that in the chat. I pasted it again. Some people, for some people, it says no changes detected. So anyone who is getting no changes detected, you can tell me if that is the case. Please make sure that you saved the file. Make sure that you change the correct model.py. Make sure by now, I think you understand the sensitivity of being in the right place at the right time. So you should be in the right folder in the right project and running the command. So in case you're getting no changes detected, let me run first and see if I didn't have a... I have to order of library manager to run this command or library manager. No, you have to run it where your manage.py is located. Manage.py is located above all of these. You can see from the output that I got, you should get something similar to this. You should get migration for library manager. Library manager slash migration, something, something. Created a model book, which is what we did. If you're not getting this, then please let me know and we can try to figure it out. It is most likely that you're not saved your model.py file. The model.py file is not in the right location. You are not in the right location. Otherwise, this doesn't need rocket science. Cool. Can you please make, sort of run these checks first and then get back to us if you still can't figure it out? In the meantime, what I'll do is I'll show you what the migration looks like. So for example, can someone tell me where the migration folder was? And I'll follow your command this time around. Can someone switch on their mic and let me know where they can find the migration folder? The library manager. Correct. So your library manager is your application. The database that you're, the table that you're creating is specific to the library manager app. Databases are specific to a project. Tables generally are specific to a particular app. So you go into library manager and you don't need to do this. I'm just showing this. Please do not, like, you don't need to move around a lot. It can get difficult at times. So it's not necessary. You have to go in and look. I'm just showing you that, so this is how the migration folder looks right now. Earlier it was empty. Now we have something called 001 initial.py. It is like a file that tells the database what to do. So, for example, there is spider. I can open that as well. So migrations. And you can see that it is also has its own class and it is telling the database that, you know, these are the dependencies. If there were any earlier migrations, it'll tell you that these are the dependencies. It'll tell you what to do. So it'll tell you to create a model. The name is a book, and these are the fields that you need to create. Any changes, anything that you do to a model.py file, you have to save it and create a migration. Unless you create a migration and migrate your database, things will not reflect in your database and your application is bound to crash, right? Going back one level. Things are not done yet. Please run the migrate command. So Python, this you already know, Python manage.py migrate. And it'll tell you that we are applying this 001 initial migration. And if this is run properly and your output looks like this and it says OK, then everything is OK, and it runs properly, right? I'll again go back and wait for you folks. So this is about it. Your model is now created. If we want to see it in... So generally models, anything on the database side interactions, they should show up in admin.py. But let's see if that happens, right? So you don't need to do this again. I'm just showing you a sample of what happens. So I'm running my server, like Prakamesh did countless times before this. Let's run the server and run the admin. Now I remember that I don't have a create super user that I remember of. So what I'll do is I will create my own. I'll call him admin123. I'll run my server again, right? So if you folks can see, we do have the Django administration interface, but it looks like it always looks like, right? So there's no change here. Now I want to make sure that like groups and users, I should be able to also see the books option here so that I can maybe see what books there are, maybe add a few books. And like I mentioned before, a basic create, read, update, delete operations should be possible from here. To be able to do that, there is one step that remains. So you've changed your model, you've created your migration. To be able to view those things in your admin, you'll see that your library manager has a small file called admin.py, which also does not have a lot of stuff inside it. Let's go back. Does it have it? I don't think so it comes with default. It does come by default. You have a file called admin.py. Let's open up and see how that looks like. In my spider file, I open another file called admin.py and as expected, it's empty. So what do we do here? We will try to see if we can get the book model to show up in our admin. To be able to do that, I will do, I'll maximize this stuff again. I'll do from.model.models to import book. Why? Because I want to be able to work with a book class. Rest of the stuff is already imported, so you don't need to import it. You need to register something with the admin.py file because the admin.py file wants to know which model you want to look at. So a register method is used to tell the admin.py file that look, I want this to be rendered on the admin interface. So I'll paste this code as well. I'm not sure if you folks can still copy paste or not, but I'll still, for instance, paste it there. That at least you can look at it while, right? Once that is done, let's go back to our command line. And as usual, because you want to see what's happening on the server, I'll run the server. I'm not in the right folder, so I'll go upstairs. I'll check again. And then I run the command. I've run the command. I go back to my browser where my admin site was open. Hopefully it should not ask me to log in again. Yeah, it doesn't ask me to log in again because it's maintained that client-side session. But you can obviously see that the books option has shown up here. It gives you the app name here. So Library Manager is the name of my app. So there's a new panel with the app name. And any models related to Library Manager, which I add to models.py, will show up here. If I register them with the admin.py file. Has everyone reached this point? So let me go back to Zoom. No, sir. Yes, sir. Are you stuck somewhere? Are you still typing? If you're still typing, I can wait. Are you still typing? Is that it? Is that the problem? Yes, sir. Are you still typing? I'm stuck somewhere. Okay. Cool. I don't know. No one can... Absolutely no one can copy. I don't know if others are there. What would you like to see on the console? The admin section with how radio adder. Yes, sir. Okay. You want to see the code? No, no. The command for admin. So there was no command for admin. There was a migration command. So have you run the migrations? They are done, right? Right. So I just ran the python manage.py run server command to run the web server. And then open add admin here. Right. Someone was asking. Sir, can you show us the code? Admin. Sir, can you share this code for models.py? Are you able to copy it from the chat? No, sir. Okay. I'll share this paste. Hopefully you can copy from it. But please don't edit it because I think it is completely publicly editable. So who all have reached the point where they have completed typing models and admin? Yes, sir. And can see the stuff in admin? No, sir. Who all are still sort of typing and still finishing up? They're still doing it. Right. So if typing takes a lot of time, you can just use this link and copy the relevant parts. And paste it the admin and the models code in that link. I think you should be able to copy paste. Just don't edit anything. Don't save anything. Just copy it from that paste. That's that. I broke the chain. First we have to put that into this file, which is called models. And what, what, what next to be done? So you have to one second, you have to edit your models.py, create the model. Okay, that's done. Then you, then you run this command, which is make migration. Okay. Then you, after that you're, after that you're supposed to migrate, which is this command. And you can then edit your admin.py with the same code that is there in that link above. Okay. You can then go to your admin, slash admin website, and then you can check if it is showing up or not. Obviously it will show up. So it's not like you need to check, but just to make sure. Right. Okay. So we may fall short of time. So I'd suggest that in case I don't mind, like this is not a typing contest anyway. So I don't mind if you copy, I'll give you the links to the text. So I'll keep editing that same link and I'll keep adding the code there. You can copy it from there. Just don't change anything in that little interface. Just, just pick up the code for models from there, for admin from there only. It looks like folks are not able to copy from the chat. No need to keep typing. Right. So let's go back to the site admin interface. So am I still running my server? Yes, my server is active and running. If you click on books, you should come to a listing page. A listing page is the one where you can see all the books in a listed format. This is basically exact fancier, you know, sort of representation of an SQL book table, just that you can do a lot of stuff here. Anywhere you are, you can add a new book. So you can add a book here. It'll ask you for the title, author name and description like we spoke about. This is our 255 character long field. You have author name again and you have text field. So text field, so basically the fields that we give in models, they are used for database validation. For example, the care field limit is validated. So I can't add anything more than 255 characters. It is also used for rendering. So anything that you render as a form or a field in your HTML or on the admin, the different fields will give you different values. So there are, there is a date time field which also gives you a fancy calendar here which can set the date time with. You have number and integer fields so that, you know, you can't add characters over there. For now, we have just used characters. So let's type in how to automate stuff. Anyway, so interesting book is the description. I think I remember Al Schweigart being the author. So I can save, I can save and add another. So it keeps me on the same interface. I can even save and keep continuing to edit. So let's say I save and continue editing. It'll keep me on the same page. It'll tell me that, you know, the book object has been saved. I can say interesting book, lots of, lots of practical projects. And I save it again and go back to my listing page. So it shows book object, right? I can add another book. So let's say this is Lord of the Rings, J-R-R-10. This is a fantasy novel, right? And I save it. So it now saved something with Book Object 2 which is the default string representation of that object. But you now have two books. You can interact with them. You can go back, edit stuff, save it. You can delete it from here, et cetera, et cetera. So this is, like I mentioned before, it's a very, I mean, it's a very decent interface to sort of do very basic stuff. So for example, if you have, if you need a basic interface to just enter marks for students, et cetera, just an admin.py and a Django server will do the job for you. You don't need to have your own interface. You don't need to create your own HTML, et cetera, et cetera. But in cases where you need your own, like you want to create your own interface, there it does make sense. So that is why we learn about the render function and HTML, et cetera, right? So this is about it with models. You now created a model. You can now interact with it and you can add or delete objects from the admin interface. There's another way to do this and it's a slightly advanced way of dealing with the model. I'll just show you a sample of that. You don't need to try this. Please don't go into the command line because then, again, you'll have to come out of it and you may change something unexpectedly. But there's a command called, if you remember Prathame is talking about it, there's a command called shell, S-H-E-L-L. This is a command line shell. So like Python has a console or Python has a Python shell. This is a Django shell. What the Django shell does is it gives you an interactive shell to sort of interact with objects within the Django module. So for example, let's see. Let's see if I can import the models here. From dot... I think the models... Dot models will not work, but let's try. Import book type. So is it not a global? So I'll have to type from library manager, I think. And then dot models. Import book. This has to work. Yes, this works. So what I've done is I've imported the book model here. Now I can interact with the table from here as well, but this is programmatically interacting with it. I use Python code to interact with it. So book.objects.all is the Django way of asking or running a query in SQL and getting all the books. So if I run this, it'll give me a query set. The query set will contain all of the books that I have in my database. What can I do with this? I can use it like any Python object. So for example, if I save it to a Python variable, I'm sure you've all been through this in the basics of Python. I've saved it to a Python variable. Now I can even iterate to it. So for B in all books, I just print the name of the book to print B.title. So you can see that it printed out the title of the two books that I already have. So this is a shell similar to a Python shell which allows you to interactively run some code which you want to test. So this is very useful when you're writing out code and you want to quickly check if this works or not, et cetera. So that is one way. This is how you interact with the SQL in Python code as well. We'll do that very soon. Let's go back to our code. That is our model.py. I'll open up the very familiar views.py now because now that we have defined the models, now that we have defined the templates, we want to now, in our views, what we will do is we will fetch all the books. What I just did on the console, I'll want to do it here so that I can send it to my template and my template can show it to the user. I want to be able to do all of that. So let's just edit the code here for a bit and we'll do the same thing. So we will import from .models, import books. We will store all books in a variable called book. Sorry, we store all the books in a variable called all books. We will get the books from the database by querying it. So I do a book.objects.all. This is just, like I mentioned, this is just a way of querying the database. It is a very specific syntax. So you just need to follow along with that syntax. And I will then, so I can then directly just pass on. So the dictionary that you see where you previously sent math and Python books is basically the dictionary that contains all the information that you want to pass to your template. So here I want to say all books. I'll use the same variable so that I remember my variables well. All books is my key and all books, that is this variable, is also my value. And we'll save it. I'll copy paste this code in the same little tool that I shared with you. So let's go there. Where is that? Save new version. Oh, nice. So now I'll share the new link with you folks. You can see the views code in this link that I just sent. Please copy paste that. And once you're done, please let me know. In the meantime, I'll keep my template file open so that I can quickly edit it. Is anyone having any issues up till this point? Only Abhishek is facing some issues, I guess. Abhishek knows a stable library manager book error is showing. So that is happening because you either did not run make migration or you did not run migrations after make migration. So your database doesn't have that table and because it doesn't have that table, it will not work. Can you share your screen and we'll try to solve your problem in the meantime? Is anyone having any issues till here? Were they able to change the code? Were they able to change the admin code? Were they able to change the views.by code? Please just let me know. Please feel free to copy the code from the link that I pasted. Please don't spend time typing. Can you share your screen please? Am I audible? Can you run the command again? Make migrations. Up arrow and enter. So you are in Django project library management Django project library management python. That is the command. Can you show me your models.py file? What was the chronology? You changed your... You already done your models. You already migrated your database. You will then change your admin.py file and be able to see your book model in your admin. After that you will change your views.py file and I'll tell you what to do next. So please change your views.py file and just wait for us there. So don't open your manage.py file. Open your models.py file right now. Migrate command was python manage.py migrate. python manage.py migrate. So it's make migration or migrate? First you have to run make migrations. So python manage.py make migrations. Second you have to run python manage.py migrate. Admin panel is not opening for me. 404 is coming. 404. Can you check... I'm sorry to ask you but are you sure the server is running? I think it is running... Sorry? Slash book... That's working. So can you check... I mean it should be slash admin. Okay I'll check it out. Sir... Sir make migration command running. No changes detected. You can help me figure this out maybe. So when I had a models.py file save problem. Can you check your models.py and make sure that you save the information? That we talked about. The code. Did you save it? Can you check your models.py file? Yes sir. Prince I do not know how to handle permissions in windows. Looks like you don't have enough permissions. What you can do is you can launch your command line. Your command line is not launched with administrator permission. If you close your command line and relaunch it with administrator permission or if you launch your Anaconda with administrator permission you should be able to access it. You should know that you don't have administrator permission. Pooja I guess if you can check and let me know. My CMD is open by administrator only. Okay so with DIR you can see the file right? Yeah with DIR I can see the template file. What is the command that you are running? It must be open somewhere else. What? It must be is it open somewhere else? No no it is not open. It is writing command like notepad.exe space template. The file name. No template is not the file name. It is a folder. Oh I have to go inside that. You can give a backslash. template backslash my library manager backslash books.html Okay thank you. I am not getting books link in my admin. I am getting groups and users. Correct so you will have to edit the admin.py. So you can see in that same link that I sent you with the code. There is an admin section with the admin.py code. Paste it in admin.py. Once you have pasted it in admin.py and save it you will be able to see it automatically in your admin section. Pooja can you show me your model.py please? Yes sir. Sir screen is visible. Sorry I can see your screen. I was just checking the path of the file. Can you please switch back to your command line. I would like to check the path there as well. If you if you are comfortable please share the whole screen. It becomes easy to switch between windows. You don't have to constantly change. I will not be able to see the text maybe because it is too small. Pooja can you compare the path that you are at here which is WPRO library management. Can you go to the models? Can you say modpan.exe space library underscore manager backslash model.py I will show you. Model file. Sir got the book link. Can you please make the changes to the views.py it is there in the same file that I sent. Can you make changes to your views.py file now? I am under doubt whether this is the correct file or not. Can you just run the notepad.exe command and we will see if it reflects there because you are running the command there. It will be more convenient to understand what is going wrong. Once I edit and show you then I will send you the code also. Please wait. Sir, you have to open the file here. Here you will not get modpan.exe space model.py you will have to give library underscore manager backslash model.py Can you share it? Yes sir. Can you share it? Yes sir. The file is open. I guess it is on different screen. That should be shared differently. That is fine. You do not need to show me. I think I know what is going wrong. You can switch to that screen if you want to. I will show you the settings.py and tell me if the library manager is there in the right install.app directory. Sir, change is done to the view files next. Yes, thank you. Just wait for a minute. Should I run the server and check the output again? No, it will not show up. But you can try to run it. Okay, I will do that. Ma'am, I did not see the model.py opened. I did not know what happened. The file was open on the screen. Yes, it was open. I did not see the screen. Okay, okay sir. You will follow the same command. Sir, did you see the screen? No, I did not see it. I can see your command line. Sir, we have options to share different screens. You can go to the north. When you share screens, you may see an entire screen option below. You do not need to do this switching business. Migrate is not running. This is your author name. The indentation of your author name is a little moving. Fix it a little. Space, space, space, space, space. In that. Okay. Figure it out. Save it. After saving, make migration. Then migrate. What happened? Just put the page. You do not need to do this. Once make migration, then migrate. No error should come. No changes detected. Make migration. Can you show me? Can you check in your settings. You do not need to show me. You have an app installed in settings.py. Let me check. There is a library manager in the installed app. Do one thing. Run the command in the chat. Make migration. Run it. Tell me if it is running. In the meantime, anyone who has not been able to reach the view.py file, edit portion. Apart from Pooja, obviously. Means sir, I am running make migration with library. Yes, run that too. In the same command, do space. Space and then that. Now. Yes, I get it. Jyoti Bansal is facing an issue with operational error. No such table. If you get no such table, that means your migration did not work. Either it is not work because of some error in your code. Or you not run the make migrations. Or you not run the migrate command. Please run make migrations. If the code is correct and then tell me if it is still not working. If it is. If the make migration gives you similar output like Pooja, for example, no changes detected. Please try this library manager. Add library manager at the end and on it and then check again. Excuse me sir. It's showing no module named models after typing manage.py make migrations. Please check the code that I sent. So, my code is here. My code is available here. Please compare your code with this. It will be difficult to look into everyone's code file at the moment. I am trying to see if we can complete this in some time. Sir, it's not working. Not working. This is weird. You are visible in the settings file in installed apps. Yes. The library manager is there. Everything is fine in the models file. But there is no message here. You can tell me with a guarantee that where you are running and where your file is the same. It is the same. It was shown in the notepad. Okay. So, you have done your migrations already. Do migrate. Do migrate. Should I run? Did the thing work? No migrations to apply. I think you already run this before and you are trying to run it again. It's not working. Firstly, make migration may be no changes detected. If you don't run it, it means something is wrong. There are already books. Yes. Then it will never detect changes. There was nothing to migrate. You were already here. You are already there. You just have to use the code and you have to paste it in use.py. So, Pooja, you are on point. I think you are just trying to run the command multiple times. So, it showed you something that you were not expecting. Sir, what you said. Okay. You forget what I said. You paste the code I have sent in use.py. And we will move forward. You are on point. You are already with us. But you just don't know that you are with us. So, don't worry. You just copy paste the use.py. Okay. So, this happened. It created a list of books and it created two books. So, what we want is we want this to be dynamic. We don't want this to be something where... Sir, we are not able to see the screen. I will share my screen. I forgot that I stopped sharing my screen. So, go back to the books.html page and please open the books.html in any favorite text editor of yours. Once you open that, we want to edit it in spider or wherever you are. And we want to make sure that the multiple books that I am sending it from my database are showing up properly. So, I will use the same code that Prasame said type. So, he already had an ordered list. I am just making it a little fancier. So, what I am doing is I am just editing it so that I can dynamically push the books that I get into the template and then be able to render it. This is called templating. So, this is called server-side templating. On the server itself, the web application, the Django framework takes the data that we sent it from the views. It picks out all those objects, all the right slots in the HTML template and then creates a complete full HTML file and throws it back at the browser. And the browser then shows you something. So, this is called server-side rendering. People who are asking about Node.js, etc. Node.js is a client-side framework. So, it does a lot of the client-side rendering, etc. Whereas Django being a server-side framework, it does a lot of things on the server side. So, what we will do is I will maximize my text size. We already have a list of books title. We have ordered list. Now, you remember that Pratamesh told you that there are some advanced programming language-like syntax. So, we have something which is similar to the Python for loop in Jinja. Jinja is a templating language here. It gives you some nice advanced features to sort of type stuff in. So, you remember that in views.py, I had sent a context. Context is what is sent to the template. So, if I sent this dictionary to my library.manager.books.html template, this variable is available to books. So, my all books is a variable. It should be accessible and I will iterate over it using the book variable and then create a list of books. So, if you do this, you should be able to get a list of the books. So, for example, you do this and save it. Let me see if my server is running. Yes, yes, yes. So, let's see what happens if I don't have an end for time. My admin works fine, but I now want to go to the books URL. You remember that the books URL corresponds to the book.html and it tells me that there is a template syntax error. So, there was some syntax that I used, but it is becoming a problem. So, I go back. I fix it. You need an end for keyword because the templating language should know that your template Jinja for loop has ended. So, I added an end for and then should work. Let's see if something else busts up. So, we have book object one and book object two, which is what we were able to see on the admin side as well. But this unfortunately doesn't give me a lot of information anyway because, you know, it's very I don't know which book it is, right? It's just one and two. How do I make out stuff like this? For this, there are different ways to do it. For example, the easiest way right now is you can do book.title because book is the object, book is the model, you know, the model instance and the model object. It has a property called title, which is the title column. So, you can do this and it would automatically render property. It is the name. Similarly, you can do all kinds of interesting stuff. So, you can pipe and just basically have some fancy text and now I also want to know the author. So, now I have book.author name, right? And I save this and this renders here. This is very fast because it is just doing HTML rendering and this is a very dumb, stupid, simple HTML page. Complex HTML pages would sort of need some time and not be but this is what you can do. So, to walk you through the syntax here you can see that there's a curly brace percentage and there's a curly brace percentage at the end and we are using a for loop. There's an end for loop. There's also like similarly there's also an if tag. So, if you want to do an if check you can also do curly braces percentage if book equals equals how to automate end with percentage curly brace. You can then have some value like hello and then you can do an end if like end for there'll be an end if. There's a lot of these nifty sort of programmatic syntaxes. We're not going to a lot of detail because it has its own little world of syntax but this is one sample. Django documentation has a very good list of syntactical tricks that you can have in JINJA. No, I don't want to save. So, you've done this now and you saved it. So, I'll copy paste this code as well so that you can check this out and try it on your own. So, if you go to books.html and you type in this code and save it you should be able to get something useful. Sorry, that last one was bad. Correct. So, I'll sort of because you've already overshot the time by about half an hour I think this is a good point to stop. This gives you a very good idea of what Django does. There are a lot more things that we were not able to cover in the sense that there's a lot more interaction that you can have. You can have form-based interactions. So, for example, you filled in a form for the book on admin interface. You can also build a very simple form on HTML pages and then have it interact with your views and models to be able to enter some data or extract some data. That's a little more, slightly more complex but it's a bare-bones HTML it's a bare-bones web app feature itself. Maybe I'll drop in more I'll drop in more documentation later on if we can. Django also has a tutorial on this. But please can you copy paste the code in books.html and please check if it works for you. If it doesn't, I can stay around and check. You can also try to add more books and you will see that it renders more books on that HTML page. This is something that you can try for now. I'll stay around, we'll stay around for maybe 15 to 20 more minutes but Thames, if that's okay with you also. Yes, yes, definitely. I think Jyoti had some error so she's done, she solved the problem. Suraj was asking about the views code. Suraj, you can look into the same link that I've pasted after your comment. It also contains the views code. You can use it to copy paste. Sir, can we leave? Okay. Were you able to run the code in your HTML file and see the output? Yes, sir. Someone asked that library manager.view.books. Fine. So for folks who have been able to do this I'll still be around to sort of solve doubts. Selva Kumar, can you please share your screen, sir? Ankit sir, I missed the last lag. What I did was I copy the paste and copy pasted the code you sent and what to check out of it. Because I was busy somewhere else, I missed that last portion. So basically, if you have changed the HTML file your books.html should now show you the same books that you have entered in your admin.py. If you go and add some new books you will see new books. So that is a dynamic page where your database is fetched and added. So I'll go through the issues one by one. So Selva Kumar, you have not yet added much of the code. So can you show me your views.py? I have a duplicate file in books, sir. I'll change it and check one second. No problem. Thank you. For Abhishek, the book is not defined error is showing so you have not imported your books properly somewhere. So it is possible that I may not have pasted the import code. So please check if you imported the books model from dot model import book somewhere. Sir, the description is not there. Sir, the description is not there. I missed the coding part of it. So that was not part of it. You are getting the title, right? Yes, that is coming. So if you see the title in the code then the book.title comes from it. If you write the book.author name then author name will come. If you write the book.description then it will come. So how is it? I'll check it out. For Suraj, you are getting list of books, all books. So your HTML is not correct. You have not put the curly braces properly or you have not ended the code properly. Please check the code. Please compare it with the code that I pasted upstairs. For Saubhagya also, you have not probably changed the book's HTML properly. Please check. Vaishnav as well, can you please check your HTML code and compare it with this URL that I sent earlier? Sir, I will send it. Okay. Sorry, what was the issue that you were having? Library. So please go to your views.views. Views. So you have defined a book's method upstairs but you have again defined a book's method here. So both of them together are causing a problem. Please fix the indentation also now that you have done this. And it should work. Thank you. Yes, Ayush. Yes. To pass the data to Bill that we have actually in the case of books we have used the interface of Django. Yes, yes. Yeah, Django interface because mostly for web apps we need an interface to add. We can do it with a command also from shell and it showed Python manage.spy shell. From there also we can create an object and we can do it from the interface like user friendly thing. Okay. Sir, I can add books, I can delete books. Is there anything else we can try? Editing book will also work. Those are the three basic operations we tend to do. As this edition was a part of a package we didn't work on deletion actually. Neither on it. Sir, what? How do the deletion is happening actually? Is it from databases? It will get deleted from database. This is Vaishnav sir. Vaishnav, yeah. Sir, I am seeing just the list of books. I mean the heading only. Yeah, I mean you can see the title you mean to say, right? I am not able to see the title sir. Titles of the author name. The author name, yeah, so you can do book.title. The way you have done, sorry, book.author, author underscore name, the attribute. So whichever book attribute you mention it will show that. I think you have mentioned book.title, no? Sir, no sir. Can you share? Anyone else with the same issue? Yeah, go to books.htm file. Sir, in the morning session I created two super users. Either way I can delete one of them. Yeah, so in your admin you can go to user and you can similarly delete but probably you should not be deleting your own user. No, I will not be deleting but just for an academic angle. I can delete them. Yes, in admin.piva you can delete. Like you did with books. Yeah, what is the output you got on the web browser? List of books. Refresh it. Many not entered books, no? Yes sir, I have entered books. Can you show admin instead of books? One minute, one minute sir. Same page, okay fine. Books, okay there are two objects. Can you show your command prompt? Yeah, you can stop this. Control C, okay. Can you show open the file books.htm over here, from here. If it's already open, close it to avoid confusion. Notepad, notepad, notepad. No, it is not here. It is in templates, no? Templates, so CD library manager. Yes, different files. Yeah, CD library manager. No, no, no, no. Do CD library manager. No, no, no, don't go behind, go ahead. CD templates, again do CD library manager. Yeah, do templates, yeah. Now do notepad. And show this file. This is the file, sure? Yes sir. Okay, then can you once show the views? Views.ky. Now you seem to, it is very, very possible that you have two different books.htm file somewhere. Okay sir. You can run the server and check again once and if it is not then definitely do from the way we are doing now from command prompt, open the notepad and do. Maybe you have mixed up, but first try once again with run server and check whether it is working. Okay sir. So I will give you a simple way to detect this, right? If you go to the same file that you showed us, right? All list of books, etc. Change it to, change list of books to list of objects. Just keep it, just change it, save it. And that static piece of text should also change in your output. If that is not changed, that means your application is looking at another file and you are looking at another file. Okay sir. Every time you open the admin page there is no password requirement. Is it okay? The session is still there. Does it work? If I do control C and then I will try it and then again I run it run server then I will be requiring the password. No, no, no. The session will be still there. I have entered only since morning and nothing has it is not asking. Yeah, if you do log up it will not ask. You need to clear the sessions. If you close the window I think by default it will again ask maybe but logout is the thing. Otherwise it will maintain preserve the session for you. Your authentication is determined by a session key that your browser maintains because you maintain the same tab and the same browser all this way. It doesn't ask to. If you log out it will again ask you for a login. If you close the browser it will again ask you for the login. If you log out it will again ask you for the login. Yeah, so Bhavakiya can share her screen. Maybe she is the only one left now. I think all have completed now. No sir. I have a doubt too sir. When I try to add a book sir I get operational error sir. Why is that so sir? Maybe table is not created. Operation error means there is some database table. You have done migration, make migrations. Yes sir. No, so go back and try again. Operation error with library manager underscore books not existent means your table was not created properly. Pay attention to what the output comes as. If it is coming back as some python code error attribute error etc. go back to your code have a look at models.py check if the spaces the indentation is correct. But if your migration runs properly then you will get a output saying that this migration ran correctly. Or it will also tell you no more changes like last time you were checking with Pooja it said that no more changes. Which means that all migration have run correctly there are no more changes. On that happens then go back to your algorithm and check again. Abhishek you need to import a book model then it will work on the top. Sir I did. Is this Abhishek? In your views go to your views and import the model book so from dot models from dot model import book on top on top. You have to type it. You have to type from from space dot models because models is in current directory right now space import which model we need we have created book capital B yeah that's it. Now check run the server and check. Yes sir I got it sir. Actually I had created the books.html in two different places so I deleted one. Okay fine. Thank you sir. Abhishek you got it right? Okay last I think one more only last who was the last one? Pratmesh sir my morning question is a pending which is very dark. Sorry what? I was asking you about administrator account Yes tell me. What is it? Sir I run it in anaconda navigator and when I am running it from base root then it is giving me the administrator command and when I have created a workshop and then I am opening the terminal then again it is giving me the administrator command prompt. CMD that is fine that is fine but the important thing is is there workshop written the environment? Yes sir. That is why I was already installing it. Okay every time it is taking your default root thing you meant to say. Yes sir. Can you share your screen even like administrator what was your command in the dark area on the left side? Sir nothing is written on the base because I did the work through base so I asked you the morning question when Pratmesh sir told me and I executed it he does not treat it in a different environment Okay you can share your screen Yes sir. Can you stop and try again? Yes you can see. Sir I am clicking on base root It is getting here Base root environment All other things are closed When there is no CMD nothing is open Correct? No sir. I think you should close this Yes sir. Now I am clicking on OPAT terminal Screen is visible? No screen is visible but I cannot see it Only I can see is the navigator Yes sir. Is it visible? Fail to create time directory and some issues definitely there Is this you are running as administrator Yes sir. Can you I am trying to open with workshop Then again this type of command Yes sir. So you can close it exit You can type exit command The same thing because it is not able to create a temp that should not happen That is the reason Can you open terminal? Sir is it visible? Yes sir. Fail to create again Temp that is I think the issue So Can you exit this also? Can you close this? Can you close this navigator also? Yes. Can you share with entire thing? That is the only thing Some is not able to create time Sir can I reopen it? Yes. The admin has an admin option Run as admin. I am sure that can be the cause That is the reason I was opening I told you yesterday that there was a problem in accessing the navigator It was not installing So when I did run as administrator After that I was opening as administrator Sir my main concern is that this is the issue of installation So otherwise in environment you will have to install Alex from morning Yes you will have to Because it is completely isolated environment from your system environment So in your system some packages will not take Basic obviously you have python or basic So it will create a separate environment for you and you will have to install Alex So there will be no default Sir there is no problem in executing the process When you first said that you have to run the command whether the version is installed or not Yes I already showed Remember in morning you said Yes I already showed Because it is fetching from the same thing That is an issue Obviously it is an issue on system level Maybe some permission issue Definitely it is not able to create some temporary things So by default it is already installing packages So basically Currently it is one whole thing It is not a separate isolated thing And there will be no error There will be no issue in your workflow But a good practice is we have an isolated virtual environment which is separate from the system So that is why Once again You can try Installing and trying it out So it should work I am sure it is definitely related to some permission It is not getting the permission I wanted to perform from you That is why I wanted to ask you Because both of them were running in parallel I closed the command Yes It will be in both It has been shared It is not separate It is one thing So it is like You use it That is the thing But normally it is not like that I will try to reinstall it With the right permission The only thing I will do is not create a temp folder Means it does not have the permission I will run as a navigator as an administrator It should be isolated It should be isolated There is no issue because of the administrator No You use the app Any app you use It is not only about Anaconda Navigator If you are admin You have the rights of a particular directory Sometimes you have to file an app to install So only admin can do that So if a normal user is there It will save but not allow There will be some error That is why Permissions are quite important Admin level user is required for such a thing Thank you so much Thank you I think we can leave the meeting Thank you for attending Thank you for your cooperation In case you have any queries You can send them via email We will try to answer them Otherwise, thank you for being here