Hello, friend, welcome back.
In a previous video, we set up our total project, so now I want to do want to work for our authentication
and for the authentication.
As I told you before, Django already provided some of the table.
That means here you can see that iCloud is a table and they use a table.
If you go to that user and the user considers that user name an the password field.
And also they have done that field as a first name, the last name and email address.
So right now, I want to do want to create one of the registration pages fast and for the registration
here, if you want to use that username, password, the first name, last name, email address, all
the field is already really made into the Django admin area.
So I have already migrated this table.
So now I want to do I want to use this.
So here with this here I want to do undertake take some of the field like here I want to take one of
the field as a username and for the registration I want to take as a password and the email address.
And also, if you want to add that fast name, that last name, you can also defining it.
So right now for doing this, we have to do we have to work in our model.
Right.
So now go to our project victory so that they are positive.
This right now, we don't need this.
I just remove everything from here, OK?
Just remove everything from here.
And now for doing this, you have to go to our project, into the project.
So that is our application into the application.
That is our model.
So we have to define our model.
Right.
So if you want to create this model, then what exactly we have to do?
So in a previous section, I have already discussed about that things with you for our database, we
have created some of that table so we can create this table, all the things from to this model.
So right now, I have already by default, one of the database tables as a user.
So do the users that have already all that filled.
So now I want to do first of all, use it.
So if you want to use it, we have to do we have to, first of all, import our authentication model.
So they have also all of the authentication model is relevant.
So now I want to call it like I just simply that from and the Django and the Django and Cantrip, OK,
done the country.
And then they have also one of the authentication models.
So I just simply call it as art and the models.
So from our authentication model, I want to do an import.
I want to import one of the model as it user friendly.
So that is actually by default already the element.
So there is an authentication model for the authentication model imposed on the model class as it users.
So with this user, we will get our all that filled with this user will get our username and password
feel FastLane for the last name of the email address.
So right now I want to do only only want to access our user name and then email address and the password.
And also if you want to define solve the external field, like right now they have the only DPL.
So if you want to add external feel like if you want to add that Facebook idea, what else?
If you want to add some of the profile picture, then you can also add that field.
OK, who can do that one step by step?
I will show you the first of all, I want to take out all that user's table, all the fields.
So if you want to defining it, we have to do have to define one of the class fast's.
I just simply defined as a class.
Everything will be very much clear.
Don't worry about it.
Just follow that in step.
So here I take one of the class name as a input profile info full.
OK, so I just name it as info so I just create on the class as a user info.
And here what exactly we have to do.
You have to define our models, models and also the model.
We have to integrate with our model class.
So I just simply defined as a model class.
Right.
So that is our class name.
And here we have to do we have to define our own.
I just take one of the variable as it user.
And with this user, I don't want to access all the different models and into these models I want to
define as a one to one field on the relationship.
OK, so I just name it as a one to one want to on field.
So I just simply defined I want one field and here I want to import our model that is a role model as
it users.
I just simply pass it on here.
So this solution will be as a one to one relation with our this class.
That means that user info plans to our user model.
So here I have already improved our user.
So we now use a model.
I want to recreate that relation.
So with this user model, as I told you, with this user model, now we can actually access our all
that field.
So whatever the field you want to take, we can actually take it.
Right.
And also after that, if we as I told you, if you want to add some of the external field like here,
I want to take one of the external field as a Facebook idea.
OK, Facebook underscore idea.
And here with this model sorry, with these models, with these models you have to define and Facebook,
it means that will be as.
You all type, so you have to define all the type so that I'm also not the type as you are.
OK, you are Millfield Field, so just name it as a ball field.
And into this, you will feel that if you want to make this field as a knowledgeable, then you can
also be finding it.
So I just simply defined all of the argument as a blank.
OK, I just make the things blank as a true.
That means there will be as an unknowable and also undertake another one.
So if you want to add another table field as a profile for the profile picture, so just name it as
a profile.
OK, profile, underscore picture.
So I take another one and that will be as a mistake.
So I just simply defined the models.
So with this model sound defined our time for the emails that have also another type as a missed field,
I just simply defined as Ms.
Field, OK, I just simply defined as the image field.
So I just simply defined that image.
And for the image here also, you have to define that.
What exactly these image will be applauded.
OK, so here also we have to define it.
So I just simply defined as upload, upload to upload to its location here.
Also we have to define that location name.
So I just simply define the location as a profile.
Profile, underscore pieces, OK, just name it as a pieces and also I want to do and to make that feel
as a blank slate, as simply defined as a blank and the true.
OK, just make that things as a blank.
True.
Perfect.
So, friend, I hope you can will understand about it.
So with this user model we can actually access all that, our default, all that field as a username
and password, feel fast for last name feel and the email address will and also additionally add another
to this field.
I add another tool of this field.
One is the Facebook idea and that is the profile picture, OK, and Facebook.
And it will be on the wall type for the reasons here.
I'd be fine with this model.
Sevda, these models by default that have that is actually a Django model.
So this Django model lively.
I want to access one of the type as the model field type and I just make the things as an animal for
the reasons I just pass on.
The argument as a blank will be as a true.
And also I take another field as a profile picture.
So with these models, I want to define our type for the emails because the profile picture will be
one of the image type.
So for the regions here, I am defined on the mistype type as the image field and this image will be
uploaded a specific some of the folder name I have defined as a profile pieces.
And I also make that field as an animal.
Right.
I think everything is very much clear to you.
And also here I defined as images will be uploaded one of this folder.
That means the profile picture folder.
So don't we have to we have to create this folder.
So for creating these in our project trajectory that see in our second project, in the second project,
I want to do and to create one of the folder.
And I just named this folder as a media, OK, just name it as a media folder.
And with the media folder here, I want to create another new folder and all this folder name will be
just like that.
That means this folder name.
So into the media folder, I want to create another folder and I just name it as a profile piece.
OK, so now I just simply say it.
So that is our profile piece.
That means all the images will be saved in particular that position that means here and also for defining
all the tasks and the choices for the reasons we in our previous section I have already discussed about
that in situ, you know, a previous section we have created of the static folder.
Right.
So now for this project, I also want to do I want to create on a very static folder.
So, you know, our second project area, I just simply defined as a new folder and I just named this
folder name.
I define a static, OK?
I just name it as a static.
So I just simply defining it.
So now we have to do we have to also add this is static in our setting different.
I think you already remember it.
So that is our setting and it is the setting area.
We have to defining it in particular that area that we see in our OS area.
So I just simply name it at the static is static, underscore directly, OK, that means the static
directly.
And here I defined that OS because we have to also join.
So I just simply define a worst part and then join and join with our base based directly.
And here we have to also define our folder names are folder.
I have defined that name as the static.
Right.
So I just simply defined as a static and also I have created another one, another one as a media.
So for the media I have to also included in our Wayzata.
So now I just name it as a media media underscore directly and then in our ways that path and then join
our base directly.
And here also we have to define our folder name.
I have created one of the folder as a media site.
Just name it as a media.
Right.
And now also we have to add to all this.
We have to have this in our CSC area.
So here we actually did that.
I think you already remember it.
So you can see that is all the access and the JavaScript and the images, all the things we have to
include it on here.
So first of all, I do want to define our aesthetic.
That really that means here we have to define that, our aesthetic files.
OK, static files and static files, I name it as a director radius, right, and then in particular,
that position we have to pass our on this variable.
So here I take it, I take that variable that we apply our aesthetic victory.
So just simply defining it on here, that is exactly a good friend.
And also, we have to add our media.
So here also after that.
After that, we have to add that media.
So better.
I just bought out the note for you.
That will be as a media.
OK, that will be as a media and the media do it for you here, we have to define as a media, OK,
media under scrutiny.
So do the media route here.
We have to define our media directly, media directly and also into the media area.
We have to post our full name as a media media underscore you, ORDELL or you will be in that position
as this will be as a media site, as simply defined that media.
OK, so make sure you add your all the static folder.
That is a static folder I have created.
And also I have created another folder as a media.
I also added our media and also I added two of these in our choice area.
So that is actually our way is the way as I have defined two of this means I have joined our baseball
with the baseball, I have joined our static this folder name and the media folder name.
So now go to our model again.
That means, you know, our locking up and the locking up, that is our models into this model said,
yeah, I want to add one of those team.
So I just take one of those.
Eighteen is Espace, double double line, double underscore and then Estin and then double on score.
And here I defined that is seen as a self.
So that is self.
And here I want to do a return.
I want to return our self and to the self here.
I want to return our disposer.
OK, so here I want to define that user and that is here to help define our one to one field, one of
the relationship and in particular that position.
I want to define our user.
That means our user model.
So into the user, into the user model area, I want to define our user name, user name.
That means that is actually our user.
That means this user model.
And also here I define our user names.
So whatever the things will define that in our user name area.
So we will actually access this user name without this user.
OK, and also here I define as a one to one field.
So here, if you want to define this type of audition's when this user will be deflected automatically,
this user related, all that our Facebook idea or the profile picture will be selected.
OK, so if you want to define this type of condition in our previous session, I have already discussed
about that things with you.
So now also you can define it like I just name it as the on the select right on Dilek.
And then with these models, with these models you have to define as a cascade.
Cascade, so this cascade, as I told you, when this user will be elected, this user related, all
that Facebook information, that means that you are ill and also profile will with elected.
So I just simply defined as a cascade.
So that is our own delay.
So it is only legs with this model.
I define that concept perfect.
And also friend here, I'm using that image to feel right.
So here we will applaud that images for day.
If you want to use that image, then you have to do you have to install one of the package so that no,
there have also in Django, they have done the package.
So and I just started I just opened our terminal and go to our positive pretty fast as a CD and then
my second project.
And here I want to install one of the packages for the images.
And if you want to uninstall it, they have also the command line as a beep and then install a beep
install and that below.
So that is actually the pilot, one of the packages.
So these packages, if you want to working with the images, then you have to install it.
So that is actually the command as a people install and that below as the enter and then it should be
downloaded.
All the files from the Internet make sure you are connected to the Internet and should be downloading
and install it in your system.
And here you can see your friend is showing us a requirement already satisfied.
That means I have already installed it.
So far, the results e actually showing that things as a requirement already satisfied rather than it
should be downloaded all the files onto the Internet.
So I have already install it for the reasons actually it's not showing like that way that there is a
requirements already satisfied and then our next president will be here.
I have defined that model.
So that is our class as a user info.
So now we have to do here using the default on right.
That means default admin into the admin.
They have already all the things.
So now we have to do we have to register it.
So if you want to register it, then you have to go through your application.
That means a logging application into the logging application.
That is our admin type.
And would that been area you have to do?
First of all here, you have to load it in.
That is the imported side just simply defined as a form and then our application.
That means that a logging application into the logging app and that is our model.
Right.
So now I to do and first of all, load it.
So here I define as a logging application.
That means the logging app into the logging app that is our models.
So just simply defended the models.
And then I want to do and import what so from our logging application that is our models into this model
that I have created this class as a user info.
So now I have to do I have to register it.
So no, I just simply copied.
And now in our admin here, I import our these user info class.
Right.
So now I want to do and register it so that you can see they have also some of the comments on the register,
your model here.
So no, I want to register it in particular that position that is the admin and the side into the admin
side.
We have to register, register and here I have to do I have to register it.
So that is our user info.
So in particular, that position I want to do and register it like a friend of mine this year you register
it and after that we have to do we have to migrate it again.
So now I just click as a save all because of all in our modules area.
I have already defined some of the fields.
Right.
So now I have already addressed some of the fields and now we have to do we have to migrate it.
So if you want to migrate it, I think you already know about it.
So in particular, that folder that we see in our second project.
So here I want to define as a magnet, as a file and the menace Lotfy and the migrate to enter.
Now you can see it's not showing as invalid Centex.
You know what this self that we see in our models into the models here, you can see I didn't defend
that kolon.
So here you have to define that gluon.
OK, so it is very much helpful.
You can see when you actually get any arrow automatically, it'll be displayed.
This error identified that here I am missing that column.
So you can see it's now perfectly now showing.
So I just updated it.
Now click the save all again.
No one to do and run it again.
So that is the fire and the minus five that magnetically going to enter.
And also here, showing us a return self used to have that I unexpected this invented block, so in
particular that area.
So here you have to do here to define these things on here, OK?
So that is actually expected.
Some of the blocks are just simply defining it on here.
Now, let's check this out again.
So if you actually face on that road, then you have to rely on it.
OK, so here I have actually missing it and also I have defined some the expenses on here.
So for the reasons here, I have to pass that things to that position.
So I just simply pass it.
And now let's check this out again.
I just click at the Save All Again, migrated again.
Click on the enter.
Yes, now I can see Snowplough perfectly magnetised, and after that, our second Kleinsorge second
line, I think you already know about it as a big pie and that man is not pie.
And that make migration's.
Migrations, and then we have to define our application and application name as a logging.
Right.
Logging under escort app.
Is simply defined as a free man as start by.
And that make migrations and the logging app to enter.
Yeah, you can see it's now successfully generated our this user model.
That means that user model I have created as a user info, it's not successfully created this model.
And now also after that we have to do have to run our migrate again that modify Manna's fight and the
migrate click on the enter.
Now everything is perfect, so no one to turn to check it, so for checking this, we have to run our
site so simply we find the pie and that man is Dot Fi and then Ron server.
We're going to enter.
Our server is now running no go to our side and here right now, I want to refresh all that minigame.
Now go to our home, yes, now can see that is actually all locking up and here I have created one of
the migration tables that is actually our user info.
Right.
So if, you know, open the user info, click on the avenue here.
You can see there is that user.
So that is all that user will be visible.
And there is I have defined that Facebook, one of the field up in the Facebook I.D. and also I did
find another name and the regular picture.
Right.
So that is our profile.
Picture perfect.
So that is the URL that feed I have defined in our model.
So if, you know, open this model again now, it should be very clear to you.
So that is are all the user.
And I have created our Facebook idea and that is another field as a profile picture.
And also you can see to the esteemed position, I have defined our user and if the user ipass our user
name.
Right.
So now I think you can all understand about it because that is that user and into this user here is
passing that user name.
OK, so for the reasons here, I have actually defined this listing.
So that is our user into this user model area.
So we passed out this user name.
So now you can see something, our user name, and that is our Facebook ID and the profile picture.
So now I want to do I want to create one of the page for our registration and the registration area.
I want to load our form.
OK, so we can do that work in our next video.
I will show you that things with a living sample.
So thanks for watching and I will see you in the next video.