WEBVTT

00:01.640 --> 00:02.480
Hi.

00:02.630 --> 00:08.450
In this video we will be talking about Django rest framework.

00:08.450 --> 00:17.510
So basically we will add rest into our Django and we'll use this framework which is you can find it

00:17.510 --> 00:23.120
on WW dot Django rest framework.org.

00:23.360 --> 00:24.470
What is rest.

00:24.500 --> 00:28.040
Rest is representational state transfer.

00:28.040 --> 00:31.910
So basically that's trend now to serve the data.

00:31.910 --> 00:37.550
If we have data on our server we need to actually to communicate with our front end.

00:37.550 --> 00:43.970
So if we have front end using some framework, we need to from that framework, ask for a data and that

00:43.970 --> 00:45.530
data will come back to us.

00:45.530 --> 00:52.670
Usually that's a Json format and then that format we can use in the framework and display somehow.

00:52.670 --> 01:01.710
So Django Rest framework will give us that opportunity to serve our backend data in a nice format that

01:01.710 --> 01:09.240
we can actually use and we'll use this chunk of rest framework for the rest of the tutorial and I will

01:09.240 --> 01:11.160
show you how to do it.

01:11.160 --> 01:17.790
So basically what we need to do in our Django is we need to add it to Django.

01:18.120 --> 01:23.490
We'll come back here and I can close those.

01:24.240 --> 01:36.600
What we need to do is we need to go to terminal and inside here we can do Pip install Django rest framework

01:36.600 --> 01:37.590
altogether.

01:37.590 --> 01:40.020
So pip install Django rest framework.

01:43.680 --> 01:48.280
And you can see Django rest framework has been installed with version 3.92.

01:48.300 --> 01:50.290
So that's done.

01:50.310 --> 01:58.890
What we also need to do is going to our project and our project is first and then inside settings.

01:59.190 --> 02:05.490
You can see here inside installed apps, whatever we add something like this.

02:05.520 --> 02:08.370
We also need to add it to installed apps.

02:09.480 --> 02:15.300
So in our case we are adding rest underscore framework.

02:18.130 --> 02:24.870
Like that, uh, like that framework and then comma at the end.

02:24.880 --> 02:32.440
So we have rest framework added to our installed apps just to make sure whatever you add it like that,

02:32.440 --> 02:35.770
you also need to make sure all the migrations will be applied.

02:35.770 --> 02:45.070
In fact, there is no migrations for this Django rest, but you might have other cases or other apps

02:46.330 --> 02:49.390
that might need to have a migrations applied.

02:49.390 --> 02:53.650
So you will have that command Python manage.py migrate.

02:53.650 --> 03:00.250
You don't need to do make migrations because if some of the frameworks will come with migration, it

03:00.250 --> 03:01.600
will be already built in.

03:01.600 --> 03:05.500
So you don't need to do make migration, just migrate and you click it.

03:05.500 --> 03:08.500
And in our case there is no migrations to apply.

03:08.530 --> 03:10.210
So we are good to go.

03:10.330 --> 03:17.620
So we have Django rest framework added to to Django and then we can use it.

03:17.620 --> 03:25.840
And in the next video I will show you how we can actually build or serve some of our data with Serializers.
