1
00:00:00,240 --> 00:00:01,020
Hello, friend.

2
00:00:01,050 --> 00:00:01,860
Welcome back.

3
00:00:02,160 --> 00:00:08,660
In a previous video, we successfully configuration our MySQL database with our Jianguo project, right?

4
00:00:09,060 --> 00:00:11,190
So now I want to do I want to migrate it.

5
00:00:11,520 --> 00:00:16,710
So in our first application into the first application, if you go to that models into the models I

6
00:00:16,710 --> 00:00:23,310
have allocated to all this debris class one of the musician and the album and for the musician, I have

7
00:00:23,310 --> 00:00:24,960
also defined some of the field.

8
00:00:24,960 --> 00:00:28,770
So they have the tree field as a first name, last name and the instrument.

9
00:00:29,070 --> 00:00:33,020
And also I have created another table class as a Alabam.

10
00:00:33,030 --> 00:00:35,460
So that is our album into this album.

11
00:00:35,460 --> 00:00:37,410
I have defined that for field.

12
00:00:37,410 --> 00:00:42,390
One is the artist name, the release date and also the number three starts.

13
00:00:42,390 --> 00:00:42,750
Right.

14
00:00:42,870 --> 00:00:45,780
And also here I define one of the artist.

15
00:00:45,780 --> 00:00:48,980
Here I define the foreign key in our musician class.

16
00:00:48,990 --> 00:00:53,970
That means in particular, that position I have defined as a foreign key one of the field and before

17
00:00:53,970 --> 00:00:55,840
we use it in our school life.

18
00:00:55,860 --> 00:00:56,190
Right.

19
00:00:56,340 --> 00:00:58,140
So right now I am actually changed.

20
00:00:58,170 --> 00:01:03,510
So right now I am working with our Maestrelli for the reasons before all that our data.

21
00:01:03,510 --> 00:01:06,940
That means here I have some of the Battalino musician, Taibi.

22
00:01:07,030 --> 00:01:09,290
I have saved some of the data in our albums.

23
00:01:09,300 --> 00:01:13,800
Tabit So right now, before all that, our Escola data is not totally gone.

24
00:01:13,800 --> 00:01:15,720
So our previous data is totally clean.

25
00:01:15,720 --> 00:01:18,900
And I want to do I want to actually, first of all, grade.

26
00:01:19,140 --> 00:01:21,810
So if you want to make it, I think you already know about it.

27
00:01:21,810 --> 00:01:23,850
I have already discussed about that things with you.

28
00:01:24,150 --> 00:01:27,430
So I have already shared some of the all the basics.

29
00:01:27,430 --> 00:01:31,460
So now together, all the best, we will create one of the core applications.

30
00:01:31,710 --> 00:01:36,800
I hope it will be very much clear to you, far better understanding how Django actually worked.

31
00:01:36,900 --> 00:01:42,300
So for doing this, I just open our Tamino into the terminal that is our project victory, as if my

32
00:01:42,300 --> 00:01:43,530
first project victory.

33
00:01:43,530 --> 00:01:44,310
That means here.

34
00:01:44,310 --> 00:01:44,630
Right.

35
00:01:44,970 --> 00:01:50,220
So in particular, that area, first of all, we have to do we have to define as a python or by whatever

36
00:01:50,220 --> 00:01:50,790
you write.

37
00:01:51,060 --> 00:01:57,960
So I just simply defined by and the man is Domantas Dumphy and then our my grid.

38
00:01:58,920 --> 00:02:00,720
So I just simply defined as a microphone.

39
00:02:00,900 --> 00:02:03,030
So first of all, we have to do we have to migrate it.

40
00:02:03,030 --> 00:02:06,240
And before I get make sure you will save your all the data.

41
00:02:06,250 --> 00:02:07,170
So I just save it.

42
00:02:07,170 --> 00:02:13,590
And now I wanted to do define the python Arbie and the man is not Fi and the mike that as they enter.

43
00:02:20,880 --> 00:02:28,080
So now it's automatically created all that database and also it's migrated in our database, and after

44
00:02:28,080 --> 00:02:30,330
that we have to do we have to run our second command.

45
00:02:30,330 --> 00:02:39,920
We are our second command was actually fired and the man is not fly and then make migration's right.

46
00:02:39,930 --> 00:02:42,410
Make my and our application folder name.

47
00:02:42,420 --> 00:02:44,840
That is our application name as a fast app.

48
00:02:45,210 --> 00:02:51,090
So I just simply defined as the fast fast underscore sorry underscore app.

49
00:02:51,660 --> 00:02:55,240
So here you have to run our second command as a five minutes.

50
00:02:55,260 --> 00:02:58,320
Why make migration's and hour fast.

51
00:02:58,450 --> 00:03:00,570
That means fast app right now.

52
00:03:00,570 --> 00:03:01,440
Click enter.

53
00:03:03,290 --> 00:03:10,850
Perfect, and after that, we have to make the leap again, so I just simply define again as a the spy

54
00:03:10,850 --> 00:03:13,760
and the manna's fi and the secret neocon because after.

55
00:03:15,750 --> 00:03:17,360
I can see everything is perfect.

56
00:03:17,720 --> 00:03:22,070
So now if you go to our database and now here if you refresh it.

57
00:03:23,720 --> 00:03:31,310
Yes, now, because a friend now is automatically created all that default database table and also I

58
00:03:31,310 --> 00:03:32,840
have created two this database.

59
00:03:32,870 --> 00:03:37,530
Maybe one is the fast app of the album, and that is our fourth step as a musician.

60
00:03:37,850 --> 00:03:41,020
So if you open it now, you can see they have no data.

61
00:03:41,030 --> 00:03:43,390
So are all the previous data is totally clean.

62
00:03:43,610 --> 00:03:48,400
And here for our musician table, I have defined three of this field as a fast name.

63
00:03:48,410 --> 00:03:50,270
There is a last name and the instrument.

64
00:03:50,450 --> 00:03:56,660
OK, so here, if you now compare it with our model, similar this model here, you can see that is

65
00:03:56,660 --> 00:03:57,930
actually our musician table.

66
00:03:57,950 --> 00:03:59,750
I have defined the three of this field.

67
00:03:59,930 --> 00:04:01,850
So now that is actually the tree of this field.

68
00:04:02,150 --> 00:04:03,770
And also there is another table.

69
00:04:03,770 --> 00:04:10,160
I have created the album and the album here you can see the name that is already listed, number three

70
00:04:10,160 --> 00:04:12,020
stars, and that is our artist ID.

71
00:04:12,320 --> 00:04:15,020
And here, one thing straight I want to share with you.

72
00:04:15,260 --> 00:04:17,480
I have already discussed about the things we do here.

73
00:04:17,480 --> 00:04:23,030
You can see I didn't find any I.D. So as I told you before, by default it will be created one of the

74
00:04:23,030 --> 00:04:23,530
I.D..

75
00:04:23,570 --> 00:04:28,970
OK, so you can say I didn't find any I.D., but it's automatically created one of the ID field.

76
00:04:28,970 --> 00:04:30,500
So that is a problem with the ID.

77
00:04:30,890 --> 00:04:39,050
If you go in musician, you can see automatically excluded on the primary as ID if you go to the structure.

78
00:04:40,690 --> 00:04:45,340
Into this structure, you can see that the primary ID so far, the results here, they told you you

79
00:04:45,340 --> 00:04:49,270
don't need to create any feel for this one automatically should be created.

80
00:04:49,510 --> 00:04:55,300
And also here I define one of the foreign key in my high definition of the foreign key for this at this

81
00:04:55,300 --> 00:05:00,670
table that this artist will into this artist feel I have defined under the foreign key in our musician

82
00:05:01,120 --> 00:05:02,860
by default automatically.

83
00:05:02,870 --> 00:05:11,200
And I was created like, if you go our album into the album, if you go to that structure here, you

84
00:05:11,200 --> 00:05:13,090
can see is automatically defined.

85
00:05:13,090 --> 00:05:18,370
Our one of the idea that means the artist ID, so that is the one of the primary key is automatically

86
00:05:18,370 --> 00:05:18,840
created.

87
00:05:18,850 --> 00:05:26,190
That means this artist ID, so this ID will be match actually our foreign key of our musician table

88
00:05:26,380 --> 00:05:27,340
with this ID.

89
00:05:27,610 --> 00:05:32,740
OK, so they have the foreign key I have defined now it's perfectly getting this I hope is very much

90
00:05:32,740 --> 00:05:33,670
clear to you right now.

91
00:05:33,790 --> 00:05:36,250
And here also I define our table.

92
00:05:36,460 --> 00:05:39,670
That is our last name as a musician and the album.

93
00:05:39,850 --> 00:05:45,910
But here if you go to a database into the database by default, it's created one of the name as a first

94
00:05:45,910 --> 00:05:46,770
application name.

95
00:05:46,780 --> 00:05:51,620
That means for first of all, it's adding our first application name and then our album name.

96
00:05:51,670 --> 00:05:52,780
That means our table name.

97
00:05:52,780 --> 00:05:53,000
Right.

98
00:05:53,290 --> 00:05:56,010
So if you want to change it, then you can also change it.

99
00:05:56,260 --> 00:06:00,710
Then you have to do you have to go to your models into these models.

100
00:06:00,730 --> 00:06:01,620
That means here.

101
00:06:01,900 --> 00:06:03,760
OK, so like after that.

102
00:06:04,210 --> 00:06:07,720
So after that I want to do I want to define the middle class.

103
00:06:08,020 --> 00:06:10,890
So here you have to define as a class.

104
00:06:11,950 --> 00:06:17,340
And here I just defined as a matter as I told you before my time is that if you want to pull out the

105
00:06:17,390 --> 00:06:21,020
glass inside to the other class, then you have to define as a middle class.

106
00:06:21,040 --> 00:06:27,160
OK, so into this middle class here, you have to defining it like here I have the front of the TV underscore

107
00:06:27,160 --> 00:06:30,220
table I want to do and to change that name.

108
00:06:30,250 --> 00:06:35,980
I want to make that name as a just album, OK, I just name it, just album.

109
00:06:36,460 --> 00:06:41,440
So if you want to actually rename your database, Phelim, that means if you want to rename this database

110
00:06:41,620 --> 00:06:46,150
table, Phelim, then you can change it with this middle class, OK, with this middle class here,

111
00:06:46,150 --> 00:06:47,720
you have to define the DeVita bill.

112
00:06:47,770 --> 00:06:54,040
And now whatever the name you want to define for this specific this class name that was specific, disturbing

113
00:06:54,040 --> 00:06:56,280
them, then you can define that things on here.

114
00:06:56,470 --> 00:07:00,520
So if you want to apply it, I show you like here you have to do you have to save all.

115
00:07:00,910 --> 00:07:05,680
So they told you before, whatever the things you will update in particular, that position after that,

116
00:07:05,680 --> 00:07:07,270
we have to round three of this comment.

117
00:07:07,690 --> 00:07:14,530
That means, first of all, we have to run our by managed by Miqdad click on the enter and then you

118
00:07:14,530 --> 00:07:21,850
have to define as and another one as a five and a minus five and make migration's.

119
00:07:21,850 --> 00:07:24,670
And our final step is to enter.

120
00:07:25,630 --> 00:07:30,870
And after that you can see Snowshoeing as a rename table for the album to album.

121
00:07:30,940 --> 00:07:35,010
OK, so you automatically now rename it and now we have to migrate it again.

122
00:07:35,690 --> 00:07:38,430
So I just using our keyboard Popke.

123
00:07:38,440 --> 00:07:42,400
So if you use it automatically it'll be getting our previous all that common.

124
00:07:42,820 --> 00:07:45,700
So now I just simply defined by a..

125
00:07:45,700 --> 00:07:48,730
By Alami again on the enter.

126
00:07:49,660 --> 00:07:51,330
So now it's perfectly updated.

127
00:07:51,340 --> 00:07:55,510
And now if you go to your database, like I said before, that was really fast.

128
00:07:55,720 --> 00:07:57,810
I'm under escort app under this album.

129
00:07:57,820 --> 00:08:00,640
So now I just changed this texture.

130
00:08:00,760 --> 00:08:01,090
Yeah.

131
00:08:01,120 --> 00:08:03,260
You can see now it's become changed.

132
00:08:03,580 --> 00:08:10,150
So now it's by default is not showing out this field every field as appropriately same, but only our

133
00:08:10,150 --> 00:08:11,870
database Debenham has become changed.

134
00:08:11,890 --> 00:08:13,520
So here I define the album.

135
00:08:14,020 --> 00:08:17,770
So here to help define that as we know our math class as the album.

136
00:08:17,920 --> 00:08:19,810
So now this debris is visible.

137
00:08:19,960 --> 00:08:22,690
So if you want to change it, then you can change it like that way.

138
00:08:22,750 --> 00:08:24,190
OK, so right now it's OK with me.

139
00:08:24,190 --> 00:08:28,170
I want to do I want to make the things that the previous one that means the default one.

140
00:08:28,780 --> 00:08:33,240
So I just simply defining it again to save all.

141
00:08:34,120 --> 00:08:42,220
And now I have to write out this command again, that military command, BHP mine is very fast and then

142
00:08:42,220 --> 00:08:45,100
we have to run our migration's.

143
00:08:46,710 --> 00:08:48,680
Migrations or final stop?

144
00:08:49,310 --> 00:08:52,610
And then also we have to run again, the migrant.

145
00:08:53,720 --> 00:08:54,690
Yeah, perfect.

146
00:08:54,710 --> 00:08:56,000
So now go here.

147
00:08:57,290 --> 00:09:03,050
Refresh it again, you can see it's now become changed again as a final step, and I hope you can will

148
00:09:03,050 --> 00:09:04,010
understand about it.

149
00:09:04,010 --> 00:09:07,360
And also here, that is our authenticated user, right.

150
00:09:07,670 --> 00:09:11,500
So before I have already created one of the authentication user.

151
00:09:11,510 --> 00:09:17,300
But right now you can see it's totally gone because here when you actually updated it by default, everything

152
00:09:17,300 --> 00:09:24,050
will be clean, like I show you, like here if you want to access our Django admin panel, like the

153
00:09:24,100 --> 00:09:28,450
is that Django had been so here we have to run our site.

154
00:09:29,150 --> 00:09:33,890
So I just started I want to do and to add a new terminal.

155
00:09:33,890 --> 00:09:41,300
And here, first of all, we have to run our server as a python python and then our managers start phy

156
00:09:42,020 --> 00:09:43,840
and then run server.

157
00:09:45,590 --> 00:09:46,610
We're going to enter.

158
00:09:49,380 --> 00:09:55,160
Ostovar is now running, and now if you go here, you can see Snow perfectly updated, but before I

159
00:09:55,160 --> 00:10:00,850
have used one of the username as a write some Jagt and also depends some of the password.

160
00:10:00,860 --> 00:10:05,120
But if you knock together Lockie, you can see it's not actually recognize your name.

161
00:10:05,120 --> 00:10:08,430
And the password because of all in our database is totally clean.

162
00:10:08,780 --> 00:10:11,640
So for the results, we have to create another super user.

163
00:10:11,720 --> 00:10:14,210
OK, so we have to create another super user.

164
00:10:14,220 --> 00:10:17,740
So if you want to create I think you already know about it, how can create it.

165
00:10:18,200 --> 00:10:22,400
So like here I want to do and open our new terminal.

166
00:10:22,670 --> 00:10:28,280
And here, first of all, if you want to create another super admin, then you have to define as a pie

167
00:10:28,760 --> 00:10:35,450
or the python and the as dot fi and then create super user.

168
00:10:35,570 --> 00:10:35,860
Right.

169
00:10:36,350 --> 00:10:43,140
So that is actually the document as if I manners file and the create and the super user perfect.

170
00:10:43,430 --> 00:10:47,150
So now I wanted to create another super user click on the enter.

171
00:10:49,690 --> 00:10:54,070
Now you can see snowshoeing as a name, as a jet, so right now it's stuck with me.

172
00:10:54,310 --> 00:10:56,510
So but I just simply copy it.

173
00:10:57,010 --> 00:10:59,860
I want to want to make the things on here.

174
00:11:00,640 --> 00:11:02,110
So that is our user name.

175
00:11:02,110 --> 00:11:08,050
And now also, if you click on the enter and also we have to define our email address, I just limit

176
00:11:08,050 --> 00:11:14,250
is Ardian or have been better at being at the red Gmail dot com.

177
00:11:15,610 --> 00:11:17,710
OK, better I just save it also.

178
00:11:22,240 --> 00:11:28,700
I just save it and also, if you don't click, enter is two bucks for your passport, so you just use

179
00:11:28,700 --> 00:11:30,310
the password again as you do me.

180
00:11:30,310 --> 00:11:31,880
One, two, three, four, five.

181
00:11:32,860 --> 00:11:37,900
And also after that, I do find another one as you do me.

182
00:11:37,930 --> 00:11:39,340
One, two, three, four, five.

183
00:11:39,430 --> 00:11:42,460
That is to confirm again, you start match.

184
00:11:42,460 --> 00:11:46,170
Maybe I some of the wrong you do me one, two, three, four or five.

185
00:11:47,050 --> 00:11:49,420
You do me one, two, three, four or five.

186
00:11:49,810 --> 00:11:50,710
I'm going to enter.

187
00:11:51,070 --> 00:11:54,340
Yeah you can see our super user created successfully.

188
00:11:54,730 --> 00:11:56,920
So now our super user is not created.

189
00:11:56,920 --> 00:12:00,770
And also I know server or Tarawallie still running.

190
00:12:00,790 --> 00:12:02,110
So now let's check this out.

191
00:12:02,650 --> 00:12:03,940
If you know, refresh it.

192
00:12:06,280 --> 00:12:11,320
Yeah, you can see now we can actually successfully locked in, so if you're not picking the lock out

193
00:12:11,500 --> 00:12:17,920
and if you now go to our locking again and hear our username, so our user name actually previous one

194
00:12:17,920 --> 00:12:19,780
just like that, same as Amjad.

195
00:12:19,780 --> 00:12:23,830
And also define the password as you do me two, three, four, five.

196
00:12:23,980 --> 00:12:26,680
OK, so that is actually our username.

197
00:12:26,950 --> 00:12:30,900
So I just have to defend that username and then the password.

198
00:12:31,210 --> 00:12:33,960
I just simply defined the password because a login.

199
00:12:34,360 --> 00:12:34,750
Yeah.

200
00:12:34,780 --> 00:12:36,340
We can see successfully logged in.

201
00:12:36,760 --> 00:12:41,050
So if you go to our musicians right now, you can see they have no data as a musician.

202
00:12:41,380 --> 00:12:47,260
And as I told you, when you update your server, that is my SQL Server, our previous all the data

203
00:12:47,260 --> 00:12:48,290
is totally gone.

204
00:12:48,430 --> 00:12:53,500
So if you want to add some of the musicians that are like that is our musician that I just want to add

205
00:12:53,500 --> 00:12:55,180
some of the data as a first name.

206
00:12:55,180 --> 00:13:06,690
I just name it as the or Karzai and then Arion and I just bought instrument as a guitar, OK?

207
00:13:06,760 --> 00:13:08,530
I just simply defined as a guitar.

208
00:13:09,010 --> 00:13:10,690
Now we to save.

209
00:13:11,320 --> 00:13:11,650
Yeah.

210
00:13:11,650 --> 00:13:13,740
You can see that right now perfectly safe.

211
00:13:13,750 --> 00:13:19,300
And now if you go to our database and here if you go to our musician.

212
00:13:20,450 --> 00:13:20,590
Yeah.

213
00:13:20,710 --> 00:13:25,870
You can see that it is by default automatically getting on of Dida and there is a first name, last

214
00:13:25,870 --> 00:13:27,760
name and our instrument.

215
00:13:28,150 --> 00:13:30,480
And also I have created one of the super user.

216
00:13:30,490 --> 00:13:33,520
Now if you go to that, our authenticated user, yes.

217
00:13:33,520 --> 00:13:39,370
You can see that there was a password that is our last login time and date and the reservoir username

218
00:13:39,370 --> 00:13:40,090
is visible.

219
00:13:40,090 --> 00:13:41,620
Email address is also available.

220
00:13:41,920 --> 00:13:42,460
Perfect.

221
00:13:42,940 --> 00:13:45,610
I hope, friend, everything is very much clear to you.

222
00:13:45,880 --> 00:13:51,670
So, you know, next video will create some of the template for our this album and the musician page

223
00:13:51,670 --> 00:13:54,660
and also will play some of the view pays for this one.

224
00:13:54,670 --> 00:13:56,480
OK, so we can do that work.

225
00:13:56,530 --> 00:13:59,650
In our next video, I will show you that things with a live example.

226
00:14:00,130 --> 00:14:03,340
So thanks for watching and I will see you in the next video.
