Hello, friend, welcome back.
In a previous video we have created on the database, and I just named the class as a blog and for the
blog to have added some of the field as a autofill blog, titles like Blog Content Blogging is published
did and the job they did.
So now I want to do I want to create another class and create another class for the comments.
And also I want to add on to the like system for the reasons I want to create another class for the
likes.
Like if you want to do that.
Well, first of all, I want to create on the class.
So here I want to create the class.
And I just named the class as a comment.
That will be our blog comment actually.
OK, that will be as a blog comment and it will be just like the same.
It's still being edited, our models and then the model.
Right.
And then here I want to do for the comment.
I want to add some of the field and before and that field here also, we have to give some of the relation
that is with this comment actually relation we have to add with our this blog and also with our this
user.
Right.
Because of all user will put that comment to a specific some of the blog.
Right.
So here we have to create both of these.
So first of all, I want to do want to add that our blog, that is which blog post.
You want to put that comment.
So with these models here, also, we have to end it there on the foreign key.
So it will be our reach class.
I think you already understand it.
It will be obviously without this class or this blog class.
Right.
So into the class area, I just simply added as the same as the on dialect and then models and then
also be as one of the function as a cascade.
So which will be as a cascade.
Right.
And also to put that relation name, that means a related name, that related name.
And for this one I name it as a blog underscore comment.
So it will be as a blog comment.
And also we have to create another relation with our user.
That means which user actually pulled that comment so far, the reasons I take another variable as user
and then with our models here also we have to declare on the foreign key and these foreign key, we
have to create that relation with our which class.
We have to create the relation with our user.
Right.
So for the regions here, I have already loaded in put our user.
So with this user, it will be just like the same as the on select, on underscore on the left with
this model and then the cascade.
So that will be as a cascade.
And also I put some of the related name related name for this, whatever he wants right now and make
it as a user.
OK, user underscore comment.
So be as a user comment I hope is very much clear to friend because of all this comment with this comment
actually connected with all of this, plus one of that user that we user actually put that comment and
this user who exactly put that comments right, that means this user put that comment through the specifics
of the block for the reasons here.
I just put that relation with our blog that is our block class and also create the relation with our
user class.
And for the comments I want to do to create some of the feel here, it will be the only one feel actually
as a comment.
OK, just name it as a comment.
And then with our models, with these models, this will be as a multiple text.
For instance, I just name as a our type will be as the text filter.
So I just simply added that textual type and also our comment that will be needed, I name it another
one as a comment underscored date and commented, will be done with the models, with these models who
should be at the date field.
Right.
And at the date and fields will be also as an auto auto now ad so auto no that I just make as a true.
So I just make it as a true.
That means automatically when this user will put that comments automatically spudding that that in the
comments that OK, so you should be automatically saved this date for the reasons here.
I make it as a true I hope it's very clear to your friend and also to do and to create another class
and to create another class for the likes.
So I just named one of the class name as it likes because of all.
I also do want to discuss about the things we do with some user if if some user wants to like some of
the post or the dislike some of the post.
So how can they do it?
OK, so for the reasons I just simply created on the class as it likes and here it will be just like
the same.
That is a modules in it, it will be integrated, our models and the model.
Right.
So that is our model.
And here we have to do we have to put.
A relation here also we have to put the relation with our SIM as a blog and the use that that means
which user like which post, right?
So that will be the same.
That will be we have to create that relation with our blog.
And also we have to create that relation with our user.
That means we choose our like our which post.
So I just simply take one of the variables as a blog and then models.
And also here we have to declare the foreign key so that these foreign keys I want to put that front
gate Guter which class or block plus.
So it will be as a blog.
And then the only clicked on underscore dialect with this model is just like the same as the cascade.
So which will be as case because that means when our D block will be elected, this small block related
lives will be selected.
OK, and also here, when our this block will be elected, when our decision will be elected, this
user related, every comment will be also elected.
So for the results here also want to do the same things as on the elect model as a cascade.
And I also want to put that on the related name related related name and related name will be as a Leicht
like Alesco block.
So here we will actually use that related name later.
So right now I just name it as a like blog and same as for the user.
For the user with this models is to be able to take one of the foreign key and then I want to create
the relation with our user model and then on the left with this model.
And it should be as a cascade.
Right.
So I just simply added as a cascade and then our related name, sorry, a related name.
And I just put that name as a Laker icon, like a user.
So that will be our name.
Perfect.
I hope is very much clear to your friend who I am actually using the comments and the lights.
And then that is our block class.
That is, are all that block class feel that your comments felt perfect.
So now we are ready to migrate it.
So if you're not together.
Savol And now to my Get Out this I blog, so open it.
So that is our appropriate location.
That means our my blog project.
So here first of all, I want to magnify it as a pie and then Manase Pie in the mix did not like to
enter.
So that is our play, our previous one look better.
I just closed it so I just simply close it and now open our terminal again and make that feel you save
all.
And now here I want to add as a pie and the manager pie and then my great.
Enter and now apply all that migration, so no one to make out this adblock, so if you want to migrate,
then by and the man is thought by and make migration's make Magnuson's our app name as the app unrecyclable
blog.
So that will be our app blog.
Right.
So that is our by Manase by MK Migration's and our blog knuckleballers enter.
Yeah, you can see so perfectly created, that means that our initialised all that fire as a model,
as our blog likes and the comments.
So that is actually our all that glass.
I have declared, you know, a particularly small area as a comment and the likes.
Perfect.
So no one to do want to actually migrate it by man is not by.
And Margaret clear enter.
Yes.
No kisses.
No successfully migrate our data database stable.
So friend here we already did our default all the database table.
Right now we can actually create some of the super user.
So as I told you before, in fundamental right now, if you run this project that is our end of the
terminal, I want to open another terminal and not server as a pie.
And the man is thought by and run server because enter.
And here you can see our subways now running, so if you now compete and now if you open it so you can
see our project is done successfully and is also here if you go to that admin.
And he could see that it had been so known to do and to create some of the super user for access our
admins, so fundamental, I have already discussed about that things with your friends.
I hope you already know about it.
So right now, I open out another terminal, this one.
So if you want to create some of the super user, then what exactly you have to do?
You have to write as a pie and the man is dot by, dot by.
And then I want to create the super user as a create super user.
Right.
So that is our common line as a pie managed by somebody who's not likely to enter.
First of all, you should be put that name as whatever you want.
So there is a clear Amjad.
So if you want, that is my default computer name.
So if you want to use it, you can use it better.
I just want to use it.
I just simply copy it.
And then you can also add another name on here.
So in fundamental, I have already discussed about the things we do.
So right now I just simply say it.
That will be our user name because they enter and then our email address.
I just name it as an admin at the rate Gmail dot com.
OK, that means that the original dot com click the enter and I just put password as you do me.
One, two, three, four, five point.
You write that password is to be not visible, so make sure you put appropriate password to enter and
again you do me one, two, three, four, five.
Because they enter.
Yeah.
You can see it's not created as a super user created successfully so better.
I want to save it.
That will be our username and password as you demand the three, four, five.
OK, so here we successfully created our user and our user name as the Amjed and that is our password
is perfect.
So now if you want to access it.
So our server is now running.
If you want to access it now, I just want to access it, refresh it.
So our password and that means our user name as a just and also password you give me one, two, three,
four, five.
Because of logging.
Yes.
You can see, you know, we can actually successfully logged in, but here our block table is not visible
because of all here.
I didn't register it right.
So here I didn't register that piece.
If you want to register it, you have to register it in our admin.
So in fundamental, I have already discussed about that things with you.
So that is, you know, are from and from our blog.
That means you can actually make that is also as a form directly.
And then with this hour from here, I want added our models and from here I want to import all the third
class.
So I have created the class as a blog.
Right.
So if you go to that models.
So I have created the class as a blog and the comment is also to add that as a comment and then another
one as it likes.
So I just simply added another one, as it looks like.
So that is all that our feel.
That means all the DOT class.
And also after that we have to do we have to register it so that because, you know, admin and then
side and the register, register and register, first of all, it will be as a blog, it will be as
a blog.
And then also it'll be another one of the comments, another one the likes.
Now if you look at the Savol and now if you refresh it.
Yes, you can see so perfectly we display our blog, so that is our application name and the application
I have created.
This one is the blogs comments and the likes.
My friend, I hope, is very much clear to you.
And also I have created another one.
I have created another model that is our user profile.
So I also want to do this study.
So that is our blogging.
Go to our app logging admin.
So first of all, here we have to add our appropriate location.
That is our models from here.
I want to import I want to put out this class as a user profile class.
Right.
And then we have to do we have to study it in our admin and then site and then register that in the
register, register our class name, our class name I have created as a user profile.
Perfect.
Now, if you click on this and now go to our back in the difference.
Yeah, you can see that is our application name as they are blogging and they are blogging here.
I have created on the table as a user profile.
And if you know, open that user profile, go to our ad profile here.
You can see that is actually our bit by default user.
And here I have created another one of the feel as a profile picture.
So now everything I think everything will be based are very clear to you here can see our user.
And there is the profile that is one of the feel of the profile picture.
So no, because it's not showing us the profile picture.
And also, if you go to our home for the blog and for the blog, if you go to that ad blog and the ad
block area here, you can see.
So that is all that our feel.
So if you go to our model, that means, you know, our blog model.
So for the blog that is our author blog title, that is Aslak, you can see that the author automatically
right now I have only one that I have created on the user as a super user is visible.
So Inupiats of the user automatically you can select that user from this position.
OK, and then there is a put a title here.
You can see I just simply here that is our Barbas name tag with this Barbas name.
I as I told you, just like that as a level.
So you should pull the title for the reasons this title is not showing as I put the title.
So here there is a title and then the flag and then whatever you will mind.
So that is also I added, I have added another one as a Barbas.
So what is in your mind and for the varvakis for the images.
I name it as a blog images so you can see snowshoeing as a blog image.
What is your mind.
And that is our text field area.
So here I have added as our image type and then for the blog content as a text field.
So that is our text feel right.
So every field is now perfectly working.
So here we successfully created the table that that stable and also we have added some of the database
table field.
So now we have to do we have textual visibility in our funding, so can visibility.
In our next video, I will show that things with the live example.
So thanks for watching and I will see you in the next video.