 So hello, I'm Prathamesh. Yesterday we saw installation of Django. You guys, you have even created a project in Django and created an app and you also ran it and you saw the admin interface. So today we'll be starting with what exactly is Django and why we are using it, like the intention behind it. Yeah, so we'll be seeing some basic things in Django. So first of all, what is Django? So obviously we know it is in Python, it is Python based and it's a web framework. So what exactly is a web framework? Web framework basically helps us in creating web apps quite easily. It provides us with a skeleton, where you can easily develop any app. I'll talk about it in a while. So what is a web framework? It provides the initial structure for the web app development. So yeah, if you want to create a website, we all know that there is a basic things that are always there. That is the login page, registration, session handling, all those things. So that is already provided by the framework and we can focus on the actual business logic, the logic that we need, instead of focusing on the common things. So web framework basically provides you with that structure, readymade structure, and you only have to build the important features that you need for your whatever business project. So also it helps you in developing an app in a standard way. So yesterday you created the project. You saw that Ankit showed you the different structure. How is the settings.file separate? Then the app file is separate. Inside app you have views, URLs, or maybe modules.py. So the structure is in such a way. So basically we, by default, follow a very standard way of development. So quite a good, it is very good if we use a framework. We automatically develop an app in a very standard way. And also it's quite easy to deploy when you use a web framework. That's a slightly advanced topic. We may not be discussing it right now. So yeah, it makes development quite easy and faster. Now you know why, because the basic structure is already present. You only have to write the logic that you need. So let's take an example of a car. So if someone wants to make a car, so the wheels, the doors, or OK, these are common things. The external structure is a common for all the cars. And it's almost of same quality. Yeah, there is slight difference, but it's almost the same. So we can readily use this. OK, it is readily available. We can simply use it. We won't focus on its creation. And we may focus on the actual engine. That is the quite important part of a car. So similar analogy we can take and understand the web app. So we can focus on the business logic, the coding part that you need, the actual logic you want for your app. For example, you're creating a question-answer app. So you don't have to focus much on the registration part, the session handling, the sign-in, log-in, log-out. That will already be provided by the web framework. You may focus on actually creating the question database, taking, adding, deleting questions. That also web frame helps you quite easily. So quite a lot of things web framework will provide you. And you only have to focus on the business logic. So authentication, session handling, some basic add, edit. Common operations add any content or edit or delete. So if you have a user. So yesterday you saw admin page, you saw users. So you can add and delete users or edit some user details. These are all common operations. So it can be automated. So web frameworks provide you with those kind of things. So it's quite helpful. And we'll learn more as we develop. Django, as we know, it's Python-based web framework. It's advantageous. It is definitely fast, not the fastest, but it is fast. Scalable, you can have multiple apps. You can easily scale it. The request handling is quite good. And it's secure also. And many more, which we all know it is one. There are many web frameworks available in Python, but Django is one of the most popular. And yeah, quite good opportunities available. So yeah, the most important thing is it's free and open source. So that is one of the biggest advantage we have. Yeah. And yeah, you don't need to have the SQL knowledge, the queries like select star from all, okay, or update, all those things, if you don't know, that is fine because Django provides its own relation manager, object relation manager. So you'll understand that. So SQL knowledge is not necessary when you use Django. Yeah, then yesterday, you saw Django installation. So it's already done. Yeah, but good practice is to create the Python virtual environment. So yesterday you and Keith introduced you to an environment, okay. So that was the environment, basically the advantage of environment is I'll let you know. So it isolates all your install packages from the system packages. So if you have a virtual environment, whatever you do, installation Django request, any module or any Python package you install will be isolated from the system. So it, you don't interfere with the system packages, okay. And it's a good practice to always have a virtual environment. The reason is, okay, you don't mix up all the packages. So you will be working on multiple projects, okay. So for certain project, you need certain Python packages, okay, and those packages are not required for some other project. So okay, you always know when you deploy something or okay, when you release publish your app, you always give a requirement file where you say these are the prerequisite that is this packages should be present. So then you should know which packages you have used to the always good practice that you isolate your project environment. So we always create a Python virtual environment. It is a very good practice. And then you start your development. Another important thing is that we are not discussing in this workshop, that is the version control. It's very good. Whenever you develop something, you use a version control. For example, Git is very good. So yeah, basically a separate environment where you can install and not install your packages. And it does not affect your system packages. So you're quite safe. So great advantage. Python and Django versions, this is always a question what versions we should use. We can use any version because the core is almost the same in all the versions. Yeah, but we always prefer using the latest version for various reasons, but I think main couple of reasons that you get to use the latest version of Python with the latest version of Django. Whereas security obviously with new versions, the security is improved. So always try to use the latest version. Yeah. Yeah, Django is basically we are creating a web app. We know the client server model. Yeah, the client sends a request, HTTP, hypertext. Everyone knows it's a transfer protocol. How the interaction happens, the protocols, okay? Basically between the client and the server. And server gives a HTTP response. So this is our client server. This is quite the common thing when there is a wearer. So yeah, this is something about Django is the design pattern, how Django is designed. Yesterday you saw that there are various folders. There is models, there is views, okay? And settings, everything is like proper structure. So basically we call it a MVT design pattern. So MVT is model, views and templates. So the idea is to separate out your models. Models means your database structure, that is your models. Then you have views which contains the logic, the business logic. And then the templates which is what the client will see. So basically it will be a HTML, okay? So separating these three out, okay? The advantage is tomorrow you create a project and there is some change in the template. The template part you want, okay, some changes. Then anyone who knows the front end can work on it without affecting, without interfering into the business logic views. So if we have everything at one place, the database query, the logic and the HTML, then okay, it will be a quite mess in maintenance of your project. Tomorrow if someone wants to edit it, I have to edit everything and it can be a trouble something. So it is very good if you have a separate things like the templates are separate, the views are separate and the models are separate. So if you change a certain part, so if you're changing the business logic, you're only working on the views, okay? Yeah, sometimes the whole three things may change, that is also fine, but it's a separate thing, okay? So a very good design pattern is MVT. So that is what we'll be seeing, we'll be doing also. So I think yeah, this is all about the slides. All right, so right now I'll stop my video. I'll be, we'll be doing a few things. Okay, let me see the chat. So yesterday we created a Django app. So I'll be also doing that right now. So if you want, you can follow me the way I'm doing, I'll be creating a separate environment. So it will be completely isolated, separate thing, which won't affect your yesterday's work. So you may follow it. If any problem, if any, okay, issue, then okay, just okay, use your yesterday's work, okay? But if you can, okay, it is a good thing, if you can follow it, okay, what I'm going to do right now. So everyone has Anaconda navigator open. Just one note, sorry, but please remember that you can only do one thing at a time. So if you follow one, either you follow today's Pathamesh's instructions and follow that. So stick with that for the rest of the session today. Or if you decide to go back to your yesterday's setup, then you'll have to again repeat some steps that Pathamesh has told you, because there'll be some ideas. Like I said, there'll be incremental steps. You can't keep switching between both, that will not work. So please stick with any one of them. We can't repeat steps again and again because it gets difficult and it's time consuming. So ideally, just follow along with what Pathamesh is saying now and follow along with their instruction, the new instruction. Yeah, so I'll be creating a new virtual environment in the Anaconda navigator. You guys can try it if you face any issue before you actually do some coding thing. You may jump to your base route yesterday's thing and you can do your file editing over there. That is not an issue. So in the Anaconda navigator, there is in environments, we have a create plus. So we can create a new environment. I'll be creating a new environment called workshop. So this will be completely isolated from the other environments, the base environment or any environment you have created. So if I, yeah, obviously you have to select Python. My default, it will set the version that you have in your system. And once you've created, okay, you can see one more environment, it's getting created. Some basic packages will be installed like the Python package manager and all set up tools. Yeah, so you may see there is a workshop. This is the environment, it's getting loaded. So not a problem. Yeah, so the workshop, my new virtual environment has been created. So I'll basically click on this arrow and open the terminal. So my terminal is open. So, yeah. What I'll do, I'll change, okay, to maybe if desktop is available, yeah. So I'll go to desktop. If you guys can go to desktop, it is fine, but I'll create one directly and I'll do all my work in that directory. So MKDIR is, okay, the command to create a directory. I'll name it MyDangoProject. Or MyDango, yeah, I'll call it MyDangoProject. Someone was saying something like this. How did you create that virtual environment? Oh, yeah. So can you see my screen? Yes, I can see now. Yeah, in environments, there is a create button over here at the bottom. Okay, it's a plus sign, plus sign. Okay. Plus sign, yeah, create, yeah, plus icon. If you click on it, okay, it will ask you for the name that you want for your virtual environment. I have given workshop. Okay. And create, it will create it. Thank you, I'll do that. Yes. So now, basically, okay, in the terminal, once you create, in the terminal, I'm creating one directory under the desktop, MyDangoProject. So MKDIR, enter, okay. So now, I'll do CD, I'll go in that directory, MyDangoProject, and if I do DIR and see, there is nothing in it, okay. It's completely empty, all right. And you guys can see my virtual environment is not based, it is the workshop. Now, if I do, okay. Sir, open the terminal, I had opened the terminal from this workshop environment. Then what next to do? You may go to your desktop, CD desktop, basically. Yeah, just, it is not a compulsory step, but it's like I want to create my whole work on like desktop thing. So necessary, it is not necessary, but if you wish, you can do the CD desktop. Okay, just a minute. Okay, and in desktop, we need to create a folder? Half-folder, so I've created MyDangoProject. Okay, so I'll be creating everything in here. MD, the command is MD? Make DIR, MKDIR. Okay, okay, sorry. Okay, sir, done. Yeah, then change the directory, CD, to go into that directory that you've created, CD, MyDangoProject. Okay. Done, sir? Done. And if you do DIR, you will see, it's empty. There won't be anything. Oh, it's empty, there are. Yeah, no files, yeah. Those are hidden things that we don't need to write now. Be concerned about it, yeah. All, this will work on, I'll tell if it is Ubuntu, I'll tell Ubuntu also takes MKDIR command. Yeah, and anyone who is facing issue can skip, as Ankit said, these is just okay. Like, you have already done this yesterday, but yeah, I'm creating it again. Yeah, run Anaconda as admin. Yeah, for Mac, it is LS. Instead of Ubuntu, you will use LS command to list your files in a directory. Okay, in Windows, you will use DIR. Linux LS, yeah, what's in the same company? Yeah, could you show your console, like what you did after MKDIR, like making the directory? Oh, okay, MKDIR, MyDangoProject, this thing you done, you're done? Yes. Yeah, after that, go into that directory. Go into that directory, change, CD is the command, CD. The folder you have created, MyDangoProject. Yeah, it's not happening there. I can copy and paste it, share with. Not happening in the sense, MKDIR is not working. And everyone, whenever you, for example, if I'm back, so if I want to go into my directory, CD, My, I can use tab button. So if you type My and you want auto-complete in your terminal, then tab is the thing to use. It's a shortcut, quite useful when you use a terminal or a command problem. So yeah, CD to my folder and CLS, I'll just clean it once. And if I do, DIR, it will be empty. Yeah, and LS is for, yeah, yeah, you can, okay, so yesterday's work is fine. You don't need to clear, if you're not comfortable and you can use yesterday thing, okay, that is fine. But then don't follow because you have already done it. So do not repeat the commands as Ankit said. Okay, this is only those who are interested in creating a separate environment and trying out things. And it will be a quick revision of yesterday's thing. So, okay, yeah, shall we, let's move ahead, guys. Yeah. Yes, sir. Yeah, thanks a lot. Okay, so my Django project, I'm in this, there is currently nothing in it. So what we will check is, do we have Django? So, we all know that we can check the module Django and we'll check its version. So what do you think, what will be the output of this? Can anyone tell me? No, Django would not be there. Yeah, no module named Django, who was it? Yeah, very good, no module, many, okay. So yeah, so basically we don't have Django and in this environment, so I'll be installing Django. So pay install Django as Ankit mentioned yesterday and those who had faced problem and did it with minus iPhone U should do that. I'll be doing normally as it will work. So pay install Django and this will install Django for me. It should install. So the yesterday installation will not work here because this is a separate environment. This is a, yeah, correct. This is a separate environment. Yesterday was a separate environment. That was a different virtual environment. Yeah, yeah, so now if I check, now I should definitely get the Django package. The Python should get the module and I'll get the version 4.1.1. So I have Django installed. Sir, but when we are running as an administrator, then after typing the command Python and Django version, it's showing the version 4.1.1. Yeah, because then, yeah, you already have it. Maybe you're using some root base, what do you say? Environment, right? Means it's not showing that you are working base environment or workshop environment. It creates like administrator account. Oh, then you may have installed it already in your, without creating a virtual environment in your account admin account, whichever account you're using, they've already installed it. That may be the case. You may have done pip install Django in that. So already before, yeah. So if it is present, then it will show you this output, the version name. Okay, okay, sir. Yeah, that is fine, you. But the good practice is you should always have a separate environment, what we are doing right now. No, sir, I'm saying, I have created separate environment. But when I open the terminal, it's not showing workshop environment or any other. It treat like administrator. Oh, you have opened from this thing. You're same thing. Yes, sir. Yes, sir. Oh, that's strange, that should not happen. Okay, fine, maybe we can figure it out later because like now, let's go with the flow. Yeah, that is not an issue right now. We'll see that something minor path issue will be there. Not a problem. Okay, sir. Yeah. Thank you. Yeah. Okay, all done with this. No, sir. Hello. Yeah, yeah, hello. After CD my Django project, what should I type? You can check whether Django is installed in your environment. I've highlighted the command, Python, space, iPhone, Django, space, iPhone, iPhone version. Sir, it says no module name. Yeah, it will say no module name Django, correct? Yes, sir. Yeah, that's it because you don't have Django installed in this environment. So what you should do next step is install it. PIP install Django. Yesterday, who did it with hyphenu option, do it with hyphenu and those are done. D-A-F-D install Django. Yeah, PIP. PIP is a Python package manager. It will basically search for the Django package and it will install it. So do it with the hyphenu option only. Life will be easier for you and us. Sir, it's been downloading. Yeah, it will. And once it's done, you can again run the same command. To run the same command, press up arrow key. Okay, you will get history of all the commands. So you don't need to retype it again. Okay. Yeah. Sir, one question is there. This environment that we have created, this one is virtual. The base is not virtual. Base is real. Base is also environment. But yeah, it's a root environment. It contains all your, what do you say, packages. So it's also an environment only. It's also an environment. But wouldn't it be qualified as an environment? Okay. Yeah, yeah, yeah. It will, it will. It will qualify as one virtual environment. Yes, sir, it's done. Okay. So it's all, all of you have, I think completed this. Yes. So I'll move ahead. Okay. So now since we have Django, and if we have just installed Django and again, there is nothing in it because it has been installed in the, obviously the packages. So there is nothing inside my folder. Now is the time to create a Django project actually using a Django. So you guys, yesterday, you all have done it. So the command works Django-admin start project and the project name. Right now we'll give the same name, library management. Okay. So Django admin, sorry, Django-admin start project, library management. This is the command that you guys, everyone used to create the project. So this will basically create your Django project. This is the start of your web app development. Okay. So once you type this, let's press enter. Yeah. And now if you do DIR in Linux, you do LS, you will see one directory created. That is library management, underscore management. Okay. Look at the spelling and the underscore, write it same as it is. Because yesterday I showed you the GitHub link. We'll be following this thing only. So here we have library management as the project, Django project. So let's keep the names straight. See, I think today you all will be quite comfortable with this because yesterday, you had done this with Ankit, the start project thing. Sir. Yeah. It says unknown command start project and oh, sorry. Django admin unknown, right? Maybe start project was a problem. Please take your spelling. Yeah, guys. If you have something you recheck it, maybe you have done some typo. Okay. That is also one thing. You should always recheck it once. Sir, could you check the chat once? Okay. There is a space between Django, I think, and admin I think hyphen over here. It is, there shouldn't be any space. Correct, try it out. So everyone can see a folder created library management. That is your project folder inside my Django project. So your project is library management. Project name, obviously it depends on your project. You can, it's a variable. It can be any name, but today we are giving it a name library management. So yeah, most of them, I think you may have done it. You may have got it. Yeah, cool. Okay. Yeah, those who have already exist means they have already created it. Don't create it again. Those who are using the yesterday's environment do not recreate the project and, okay, the app because you have already created it, all right? Yeah, someone was saying something. I said done, sir. Yeah, and Aniket, Shinde, I think, I hope you have installed, pip install hyphen you, capital U Django. That will solve your issue. I think it's the same yesterday's issue. Okay, okay. So now, we all see a folder library management and if I, okay, see what is inside it. I do CD, I go to that directory. I'll do DIR and I see there is one more folder, library management and a file manage.py. So now, so why there is two folders created? So the parent folder library management that is present is like a cat, like it's an enclosure type. It is okay, like a container of your whole project. So that is why you have one library management folder and then one more within it. And inside this will be all your project, whole project settings. Okay, so if you go again in this library management and now I do DIR, okay, I'll see the whole project, anything that is related to the project is over here. As we, we don't have to worry about these two files. These are mainly, okay, for development, sorry, deployment version, live deployment. So let's not focus on this. Yeah, the most important file is settings.py. And obviously everyone now by now, since you have followed Python basic tutorial, the videos, you all know why there is init.py so that we can import, okay, any, okay, class from, we can import the Python package from, okay, this folder itself. So settings.py, we saw it yesterday. So we'll not be looking at it again right now. So I'll go back, these steps you don't need to do. You are already aware of it. So it's fine, I'll go back. To go back, I'll do CD space, dot, dot, dot. I'll go one directly back. So now I'm back to my Django project. So I think everyone are at this point right now. And they have seen the library management thing. All right, yeah. Everyone will, those who have finished at this point can type the command cd space library management. So we'll be entering the project, the container. So cd space library underscore management. You will see that now you are inside the library underscore management folder. Yeah. Still on backslash my Django project, I'm unable to add the library management thing into. Yeah, you have to do, you do dir, what does it show? Yes, sir. Is it same as what you see on my screen? Yeah, yeah. And now do cd. What you should do is you type first three, two, two, three letters and then press tab, it auto completes. So you don't make a typo, everyone. Okay, so then press enter and you enter the folder, the project folder, library underscore management. These two library management, this has been created by default. But yesterday we created library manager within the library management. Yeah, that is the app. We'll be doing that also. This is a project. Inside project, you can have multiple apps. That is why there is this container folder. So if I do now dir, I can see manage.py. I see this library manager. This contains all the settings related to the project. Now, if you create an app library manager, it will be present in over here, somewhere over here. And this acts as a container for every, all the apps in your project. And this acts as a, okay, all the dependencies, okay, settings related to your project, like that. So this is like a container of your whole Django project. Project can have multiple apps. Yeah, exactly. So you can create multiple apps. So, okay, all will be present in over here. Right now we don't have any app. We'll be creating the library manager. Yeah. So all at the same stage. I hope yes, done. Okay, great. All right. So now before we create an app, we'll simply, we see manage.py. Yesterday we saw the power of manage.py. It is the command line utility for Django to make the life simple. Yeah, okay. So it definitely is like making things quite simple. So now we don't have to use every time Django admin command like we did for start project. So what we did? So this Django-admin is also a command line utility where we can create things, do things quite nicely. But once you create the project, you have to forget about Django-admin and you can simply work with manage.py. Sir? Yes, yes. I have written the command c, underscore management. It says the system cannot find the path specified. Yeah, you have written cd space, library underscore management, right? Yes. Yeah, and okay, can you do dir? You're using Windows, right? Yes, sir. Yeah, dir. Do you see the library underscore management folder? No, sir. My Django project is there. Yeah, go into my Django project, cd my Django project, cd space, type my and press tab. It will autocomplete for you. It will be faster. I'll press cd space, my Django. Yeah, tap, tap, autocomplete. Enter. Yes, sir. Enter. Yeah, you got into that directory? My Django project? Yes, sir. Yeah, can you see library underscore management? Yes, sir, I can see it. Now do cd space library type li and just press tab, it will autocomplete. Yes, sir. Now press enter and you have entered the thing. Like ready managed, yes, sir. Yeah, then do dir, you can see manage.py. Yes, sir, that is a managed.py. Yeah, yeah, great, move it. Yeah, so wherever we, so see if I, if I just type python manage.py and press enter and it tells me that the available commands are all these lists, all the lists. So yesterday you all have used create super user. I hope you all remember, right? You created a super user, this command was used and this is provided by the auth app of Django. It is already available, so nice for us. Okay, then you also, there are so many commands. I think with time you will be using a few. You also used migrate, okay, for applying the data, for creating database tables, this command. Then the shell is one of the most powerful, quite useful. You used a start app, start project and this is just for information. Okay, don't try anything right now and we have run server also. So what we are going to do is we are going to do python manage.py, type ma and press tab, it will autocomplete. Always use the, take advantage of tab and run server, the command. So ever if you forget any command, you can always refer this list and oh, I've made some typo, oh, I forgot this. So this is quite helpful. Okay, now if I press enter, okay, it will tell me that the server is a development service running at this location and yesterday also was the same location. All right, I'll just go there. Okay, before I move to that, I hope all of you have reached and now, okay, you can, obviously yesterday also you have, you have done similar and yeah, yeah, someone was saying something. I have some message in red color. You have 80, 18 unapplied migration. Your project may not work properly. Then that is because, see migration means, okay, I'll talk about this in a while. Point is, this is just that you don't have any database created. So this will create problem at some point, but right now we are not using any database. So basically you will get, this last two lines will be there, starting development server, right? No, no, no issues. It is a warning thing. Definitely it will create issue later, okay? So we'll see that. Yeah, yeah, that is a slight notice. Yeah, okay. Yesterday this warning was in red color. Today there was no red color actually. Any reason for that? Okay, I'm sure. Yesterday it was on, sorry. Yesterday it was working on Linux. Linux, yeah, Linux it will show red and Windows it won't show red. Yeah, that is the only difference here. So okay, great. And you can see that it is using the settings from library management, which settings files, okay, the settings files. So the server needs to know what are the settings. So okay, I think all of you on the same thing. So now we can do localhost. Not works, Poland 8000. And if you press enter, you will see, yeah, so the same message will be available over here. Everyone got this thing. Localhost, Poland 8000, got it, sir. Yeah, the most interesting thing is, okay, whenever after the workshop in, okay, your coming future, if you are like developing, doing development on Django, the best Django documentation is over here. Okay, quite detailed. You can definitely always revisit it and okay, you can find out a lot of things. Many things are there. Okay, so it's readily available for us. Okay, so now yesterday, I think you also saw admin, like this, slash admin, you got this, right? Yes, sir. Yeah, so now we have not, if it's a new virtual environment, we don't have the super user, the admin user. So we need to create one. If you are using the older yesterday's thing, you don't have to create again, even if you create again, it's not a problem, but the user name should be different. All right, let's come back here. Now, let's control C to exit, or the way you used to exit yesterday, similarly. So again, exit from the server and shut down the server. Okay, control C may help you or control break, control FN to be simultaneously. Okay, so all at the same point. So how did you go from simple Django page to admin page? Just slash admin. Slash admin, I'll try. Yeah, okay. I can't get the command from control C, you got? Yes, sir. Okay, great. Okay, so now we need to create the super user and we know the command. And so Python manage.py again, we'll use this command line utility provided by Django and create super user. Now, this should be a problem because okay, the warning was there in the migration. Let's see what happens. Python space manage.py create super user. I should get some error, I think, yeah. So if I run, what, what, sorry. Did we already create the create start app command? Did we do that? No. No, no, no, I think I'll do it later. If you run this command, Python manage.py create super user. You'll get this error that there is no such table or user. Everyone gets the same error. And if you are using the old, yesterday's thing, you won't get the error because you have already created, you have done the migration yesterday. I have not done the migration, right? Yes. All getting the message, no such table authorized user. Yes, yes. Very good. Yeah, that is the error we'll get. Yeah. So why we are getting this error because we have not applied the migration since we have not created the database. So before creating that, let's understand what is actually happening over here. So I'll show you, you guys can just see this. So I'm doing the IR. Okay, I see, okay, library management thing. I'll go there. Or maybe let me see, I can do this, not bad. So I'll go to library management slash settings.py. So what I'm doing is I'm opening the settings.py file, okay? Again, the thing is you can use any text editor and using a basic notepad, which will always be present in all the things. And if you are using Linux, you can use the text editor, okay, which will always be there. Yeah, so settings.py file. Yesterday, all of you saw this, right? Aniket Shinde has been asking for the past sometime that he's not able to run the Django admin command. Please run pip install hyphen capital U Django and then run the command again because otherwise it is not recognized Django admin as a legal command. Subbada is asking what to do after running the run server command. So I guess Prathamesh, can you just recap what you did after run server? Yeah, so after you run the server, you may see the message that the server is running and then you go to the browser, any browser, that is, okay, any web browser you can go and just type localhost colon 8000 is fine if you want slash admin. Now it won't show because I've shut down my server. Okay, but once you run the server, you will see admin page. Or even simple localhost will also work. Localhost colon 8000. Okay, whoever are stuck, please reply on the message so we understand you have followed and completed. Sanjithi asked, can you please tell again the super user command? Super user command is python manage.py create super user with more space, create super user. Subbada has done very good, yeah. Aniket, you may have to run the Anaconda as administrator, that is one solution or you have to install the pip install package in your environment using the hyphen u tag. If you're using a new environment like today, you'll have to run the command again. Also try with administrator command that those are the two things that solve the problem for 99% of the people. If you're using, if you're not using Anaconda you're using something else, then I'm not aware of it. So it will be difficult to help you. Maybe we can help you in the break or something of that scenario. But if you already done this yesterday, then I'd recommend that you wait and not follow along these instructions today and just use the yesterday's directory. Anybody who's falling behind, please remember you can switch to yesterday's directory and use that if you want to. Thank you. Yeah, well, it shouldn't show any problem 127 because it is showing problem. Abhishek, because you have put colon over here. It should be 127 dot, okay? Yeah, so that is the issue. I think Abhishek is done. I suppose, okay. And so, the command is wrong. That is why I've written the command, it will be. And you don't have to, okay, you can do that. But if you want, you can open the settings.py in any text editor. Yesterday, you had opened in a spider, I guess. Right, Ankit had shown that. Yeah, all right. Yeah, Nikhil. I have got notepad on my screen. Yeah, yeah, notepad, fine. This thing, right? The way I have. Yes, sir. Yeah, yeah, fine. So basically, intention is to show you all the settings.py file. So I've opened the settings.py, let me increase the font. Yeah, in settings.py file, you can see that in your project, these are all the default installed apps. And Django has already done this for us. Which app admin app is there? So whatever admin thing you are using, you can see is because of this app, auth for creating user, okay, sessions, all this, okay, basically is already provided by Django. So these are the apps installed. And if you look at the message that you get, error message, if you go back slightly. So we can see for auth, there is no such table auth user. Okay, this is because these apps are present, but we have not created the tables, the database for these apps. Okay, so we need to run one command, which will create the tables for the given app. Okay, and the command is Python minus.py migrate. So migrate will automatically look into the individual apps, whatever apps are installed over here. Okay, it will go to those apps. It will look for its models. Okay, that will be one folder migration, which will be present in each app. And it will have all the instructions to create the table. And once you run this migrate command, it will trigger that and it will create the table for you. So if you run this command, it will show applying, applying the migration. So if you see what is written over here, okay, it will apply migration for all the apps. And these are the apps, okay, which are present over here in your settings. Okay, and it is applying, applying. And okay, if you see, okay, sometimes, okay, with time, we change the database model structure also. We definitely have, sometimes I want to increase the length and alter whatever. Okay, so if I make changes, it will be recorded, okay, in that particular app. Okay, and those things will be applied. We won't talk much about this right now. You will slowly, once you start development in Django, you will understand it naturally. It is that simple. Okay, so now basically my tables, okay, are ready and I can, okay, proceed ahead. So everyone, okay, can simply run this command, python-manage.py migrate. That is why when we were first running the run server, it gave us the warning that you have not created a table, but still we ran it, we used it, but now we need the table. We need to create super user. The entry will go in the table. So in that context, we need to now create. Now, we can't ignore it. All done, all have executed this. Yes, sir. I'll just repeat again, in case anyone is still facing issues, it is very difficult to be able to answer your question chat and then for you to follow along on screen. So for example, Aniket has been asking that he cannot see the library management folder. Please understand, you have to create the desktop folder. You have to create my Django project. You have to run start project command. You have to run the start app command. You have to run the migrate command and then you can run the run server. These are the basic steps. But otherwise, if you can't follow along, I understand it can be tough at times. Please do not get too confused. You can fall back on the folder that you created yesterday. Also, please understand that any changes from a certain point onwards, Prathamesh, please tell them as to from what point they can start reusing the folder, the folder. Yesterday, right? Correct. If you do changes here and then you go to the old folder and you go to bed, that won't work either. Please understand. The intention of right now this session is basically you should understand what is happening in Django. What is the flow? What exactly is like virtual environment? How Django looks at the settings and takes all the app? What is this migration thing? So that is the intention. So yesterday, you have done installation. You have followed all the steps. The intention of this is basically to understand what exactly you were doing and how it happens. So that is the intention. So in case you want to use the previous thing, you can switch that, but I'll tell you the point at what point you should switch back. So don't worry if you are getting some issue. I can see the chat that I did not much of issues and the issues are also minor, not like very complex things. So okay, not an issue. Okay, good. All right, let's continue. Yes, sir. So for Omkar was saying repeated, I'm saying you have to run the command python manage.py migrate. So this command will create the tables, the database, okay, which is for all the apps which are mentioned in your settings.py file. Once you're done with this command, please let me know. Done, sir. Done, okay. Okay. I guess we'll move ahead majority, the same track. So yeah, so now we have created the table. Now let's press only up arrow and get create user command, create super user command. So see, I'm not typing. I'm just pressing up arrow and down arrow to just get my history of command. So this is a quite useful thing. You also should do this, it will be faster. And now if I create a super user, okay. What will happen? Now it will work fine because now it finds the table where it can store the value. So I'll create username, email currently I'm omitting, it is fine, password super user created. All of you can do this. Sir, it says unknown command. Did you mean super? Can you check the spelling and all, create super user? Create super user, sir. It's correct, sir. It's correct. Who has the problem? Can I know? Sir, it's me, Nikhil most. Nikhil, okay. So you are in this python manage.py is working. Can you type python space manage.py enter? You can see list of all the commands. Yes, sir. I have applied a migrate to every. Okay. Then python space manage.py space create super user. Yes, I have typed the command, but it says unknown command. Did you mean create super user again? Question mark. I don't know why, what is it? Type manage or help for usage. It's possible that you're using the wrong spelling. Can you paste the command in the chat? Yeah, paste what command you have done. Spelling typo will be there. Yes, sir. And anyone pasting the output also please tell us which command you ran. Because you will give us the output, but we don't know what you ran before that. Yeah, Nikhil spelling is wrong. Yeah, as I told you, check the spelling, create spelling is wrong. So guys, check the spelling and more awesome, right? The command is wrong. You're using migrate, you're using super create at one same time. Migration is done. Now it's create super user command. So obviously it will create an issue. So it's clearly, I've typed it. No, you have done with migration. I can manage that by create super user. Okay. And when we recommend the solution, please just take a minute to go back and try it. For example, Nikhil Pratham is already asked you, can you please check the spelling? So it is better if you just go back and check the spelling because then it solves the problem then and then, right? So thank you. Yeah. So, all right. Let's move ahead. All of you have created the super user. Then let's run the server again. App arrow will help you. Don't type the command if it is creating typos, you're creating typing mistake. So app arrow will somewhere find in your history, the run server command. Oh, I've lost it, I guess. Fine. For me, it's okay. I'll type. Okay. So run server. Python space manage.py space run server will run the server. And if I move back to this point admin, I will see again the username password. Now you all should be slightly quick because this steps now, I think you have repeated almost 10 times. So all should be slightly faster. So I'll type the username password. And if I log in, I'll see the Django administration play page where already the apps and all the details are there. Yeah, that you can, okay, just check later. You don't need to check what I'm doing right now, but just your admin login is working. This page will be quite useful for managing all your database, okay, like tables. So users is one table where you can definitely I'll get a lot of things. Yeah. So I hope. Password is in type one. Password will be blank only. It will not be visible. You have to type something. It will not be visible, but it is getting typed and press enter. Yeah. Yeah, after you create super user, you need to simply run the server. I can manage dot find, run server. And you need to start the server to see, once you start the server, then only you will see, okay, this URL, okay, output you can see. Once you request for this URL, okay, it will give us the output because server needs to serve, right? So server needs to be started. The server he, I'm starting it, it will be blank. So we always need to start the server first. To servers, always remember this. Okay. So you are asking for the part of the navigation. Yeah, you, yeah. So there will be. Have you, your server is running? Have you run this, come on? Yeah. It's showing that server started at this localhost whatever, 127, 0, 0, 1, 8,000. Is there aspect for this the proxy for our proxy? No, that shouldn't, it's a localhost, no, it shouldn't ask. Maybe once again. Yeah. My email password combination is not working. Should I create a new super user? I may have typed wrong. Okay, yeah, you can create a new super user. You can give a different name password. Yeah, and you can do that. You can get multiple. I have to give different email as well. Okay, email ID will, yeah, slight, I think different. It should be the primary key maybe then. So yeah, yeah, you can ignore email ID for now. You can keep it blank, email ID actually. It's fine. Same email ID will also work, but keep it blank. Blank, not an issue. Okay. So where is the admin page, sir? Yeah, Ankith has posted the localhost. This is the admin page, what is that? So localhost slash admin in your browser. You'll see the admin page. You'll have to log in with your super user that you created right now. Yeah, press Y, small Y, bypass the validation. Vivek, so if you can't reach the page, please try 127.0.0.1 colon 8000 slash admin. Please check your URL, please check the spelling, please check the dot. Please try it in your browser and see if it works. Either 127.0.0.1 colon 8000 or localhost colon 8000. Localhost is simpler to type. So you may try localhost. If it is not working, make sure that you've typed in sttps and not just sttp. I think someone just mentioned that they have an issue with the local network in their college. It is very probable that someone, if there is someone around, they could possibly help you because it sometimes happens that the loopback addresses also get blocked by firewalls, but usually they should work. So please try both 127 option and the localhost option and see if it works. Yeah. Okay, we'll wait for a couple of minutes. Yeah, Abhishek, I'll answer your question slightly later, no worries. Okay. Sir, both it says can't reach this page checking the boxy under fire. Fire? Using both the host local as well as 127.00. Yeah, Nikhil, your server is running. I can manage that. I run service. Yes, sir. Okay. So should I use my personal network for the... Yeah, fine, fine. That is not a problem. Yeah, that should work basically. Yeah. Well, I'm using this college network. So should I use the personal network? Yeah, not a problem you can use. Okay. Sir, yeah, like the guy was finding the issue like... Tell him to run this server command again because the issue was solved. Okay, yeah, okay. So, Nikhil, you can restart the server and try. If anyone who is not able to see, yeah, maybe try restarting, it may solve. Yeah, awesome, great, good, nice. Okay. Is there any limit on how many super you can create? No limit, no limit, you can create. Basically, you yourself will be the admin and you will give the privileges, right? So it's on you. You can have multiple and number. Okay, I'm slightly currently, I log out. It's fine to log out, not a problem. Okay, I can't reach out, I've stopped the server, see. So I get the message. Sir, in the command class, sorry, command class, should I use the control C to come out of it? Yeah, control C will help. Yeah. So at this point, you should be able to run your server, you should be able to access your admin interface, you should be able to log into it. These are the three things that are possible. Any of these three things not happening, then you can please take a minute to ask questions now because we'll stop for that. So it's still not been reached. Okay, can you please, I think so Pratham, I have stopped sharing your screen, can you share your screen and we can try to help you out? Yeah, yes, sir, just give me a second, sir. Yes, can you show me the command line interface also? Okay, so is your server running? Yes. Not the side, but. No, no, no, no, no, in your command line, in your command line interface, the run server command should have been running and you should have had a server command prompt there. Please run Python space, manage.py, space run server. When you run this command, that means that your test server is up and running. It gives you some output. That gives you an idea that your server is running. You cannot, you will not be able to type anything else. Right? If that is happening, then your server is running, which is why Pratham has asked you to go back and check if your server was running, right? Type run server and press enter. Now should I, Python managed.py, now should I write run server? Correct, your server spelling looks to be wrong. Press up arrow. Press up arrow and then edit the original command. Go back and he. Enter. So if something like this is showing on your screen and if there are additional rows of information running on your screen, that means the server is running, right? If this is not running, you will not be able to access anything because there is nothing for the client to communicate with, right? So whenever someone is asking you or telling you to check something, please take a deep breath, check, then come back to us. Let us know, no problem, we'll try to help you. But if you, like if you just say yes, it is so then it is difficult to troubleshoot, right? You may not be able to log in right now. Have you done the create super user command? If you've done that, then you can log in. I have done it, sir. Cool, then you can try and log in now. Here's my user name as well as password successful, created successful. Okay, so everyone, okay, are able to see the admin page. You can come back to your terminal. You can press control C to exit your running server. That is the way you can stop your server. Remember, as Ankit mentioned, that whenever you want to see some output on your web browser, your server should be running and the command is python space managed by run server. Then only it will serve you with the web page. Otherwise, you will see nothing, the error you will see, okay? Or basically nothing you will see. So remember that and to come out, you have to stop the server, okay? Use control C, control break, or control function B, whichever works for you. Okay, run output, okay? What I want, one more thing I want to show you is, okay, you can just see that in settings.py, there is one more, okay, thing. Yeah, library management, if I do a DIR over here on the terminal, you can see magically there is one more file created, db.sqlite3, previously it was not there. If you all have observed this, there was no db.sqlite3, correct? Can anyone say yes, no? Yes, sir, it was not there. Yes, yes. It was not there. It was, it got created when you did migrations. Okay, it gets created once you trigger anything related to migration, all right? And it will contain all your table. Obviously, I will not go inside this, okay? Yeah, so from where it happens is in your settings. Do you see some db settings are there? Let us see, yeah, database settings. Okay, here there is again a reference to the document docs, okay? Where I suggest whenever you need some development, you should always read the document before you do some additional development. Right now by default, the database engine is SQLite, okay? You can use my SQL. We are not using it right now. You can also use Postgres, okay? So there are different backends engine. We are using SQLite 3 because it is quite easy to set up. You don't have, my SQL will take a lot of time, but you can anytime go for that also. So here we have mentioned the name, okay, db.sqlite3. So all, okay, your things will be, okay, in this, db.sqlite3, okay? I'm not sure whether I have SQLite 3. Okay, I have it. Don't do this, okay? For all of you, don't do this. I'm just showing what is inside this, okay? I'll do tables. See, these are the tables present, okay? Inside this. And there is this alt user. We had got the error. Okay, if I do select start from, you don't have to do this. Everyone knows SQL, so we are not going to do this. But if I, okay, do this, I can see my super user pratham I had created, okay? Yeah, so I'm again back to this. The intention is to show what is happening, okay? Actually, so yeah, this is about the db. Now, okay, we are moving one step ahead, okay? And we are going to create our own view, okay? So let's go there. So this is the library management system. Okay, so now, let me check the chat, any. Thanks, I will see that later. Okay, these are normal text things, so not a problem. So, okay, so we are, we'll move ahead. Everyone on the terminal India container folder, if I do dr, you all see this? Yes, sir. Cool, okay, very good. Okay, so what now I'll do is, okay, I'll create an app. Now is the time I'm going to create an app. Everyone knows what is the command for creating an app. Yesterday you had created, who will say? Startup. Very good, Ben. Library manager. App name, okay, app name can be anything. We'll give a library manager to be in sync. Okay, so I'm now creating, okay, basically an app. So yeah, if I run this, if you're all, you're using the older thing, do not create again. It will show an error. You already have this app. So if you're using a new environment, you need to create this library underscore manager app. So once you run this command, you can always check using LS in Linux and DIR in Windows to see whether it has been created or not. So library underscore manager app has been created. Prathamesh, what did you use to exit the SQLite prompt? Control C. Yeah, so anyone who's still stuck in SQLite 3 prompt, please use Control C. It is not compulsory to run those commands. He was just showing you that a database exists. SQLite 3 is not a part of this whole core thing. So please just exit out of that and follow along on the, on-screen instruction. Yeah, after SQLite 3, you need to run, you need to create the app. If you're in a new virtual environment, you don't have your app you need to create. If you're using the older yesterday's thing, do not run this command. You already have it. Done, sir. A library manager folder is created. Nice, awesome. Okay, I'll go and see the chat. Okay, I think I'll have got it. I assume that because, simple. Okay, so now if I check what is in this, I'm just checking it even if you may not do this because yesterday Anki that showed you this, I'll just show you, oh, not LS, yeah, yeah. Yeah, I'm quite used to Linux, but, so yeah, so we have all these files auto-created. So see how standardized it is. That is what we saw in the slides I was mentioning that everything okay is nicely, okay, isolated, okay, done by auto-done by whom? By the Django itself. So we are forced, not forced, it is telling us to create your database separately, create your views, business logic separately. So it is okay, kind of forcing us, but it is not compulsion, but it's a good practice. So a quite standard way of developing something. And you will slowly, okay, also realize it, how important it is to segregate things and do developing. Okay, so this is what is present in it inside the library manager app. When you create models, you need to tell your settings.py, okay, that you have an app, look at that app because, okay, that app will also have some database, some model. So that is the reason why we will add our app in this installed app. Yesterday also you had done the thing, the library manager, it is always a good practice initially once you create the app, just mention it in your installed apps, okay, and you can save it. Do not forget to save the file, control S will save it or any save button from, okay, the top will also save it, done, okay, great. So, yeah, I hope all have edited the settings.py file, just edit this app that you have just created. If you have already done, don't do it again. That is also one thing. Yeah, it's, why that is one, I don't know, maybe you have created in that name. Okay. Yeah, that is fine, she has created, I think she's mentioned that name. Yeah, but it will, okay, fine. Okay, I think all have done that, and after that, okay, I think let's come back here. Okay, so if you all are in this library management, kindly go inside your app, to go in your app folder, do CD, and mention what is your app name, library manager, and press enter. You will see you are inside the library manager. I think now you all are quite comfortable with this CD. Now, once all are inside the library manager and can see these files, once they do LS or DIR, let me know, I'll move ahead. Sir, I am in library manager, but I can't see the files. What command DIR you have used? CD library underscore manager, CD space library underscore manager. Are you pressed enter? Yes, sir. I have entered the, it shows in my command that library manages, but it's not showing the folders that you have shown 66 views or five. Yeah, can you do DIR? Yes, sir. Enter? Yeah, no, it was the DIR. DIR means to list all the directories and files in your current directories. Okay, sir. Sir, the files are not exactly the same. For example, migration is not there directly. Yeah, fine, that is fine. Migrations gets created automatically. You don't need to worry, even if you do a Python manage.py, it will get created automatically, so not a problem. But others are also not exactly the same. Should I share it or is it fine? Actually, you heard me. Actually, the migrations will be created automatically, so not a problem. Not only that. Once you run Python manage.py migrate related to this models, it will take some time, it will auto create, so not an issue. If migrations, if you don't see it, it's fine. A slight version issues may also be the case. It has other differences also. What other differences? Can you paste the output in there? I'll paste the output, sir. I'll just hold on, along with the... Yeah. Okay. No, no, no, you are in library management. You should go to the app. Go back. Sorry, sorry. Yeah, go in library manager, manager. I incidentally use the tab and in fact... No, no, then if there are multiple options, press one more time tab. It will show all the possible options. Okay, okay, I got it. Yeah, got it, yeah. Migrations should also be there. A migration is also there. Yeah, it will be empty basically. But you may check, if you are comfortable moving around and check, it should be empty because we don't have any currently database structure. Yes, sir, got it now. Yeah, thank you guys.