Okay.
Now we know how to build a Django and how to use that framework.
We can start our project.
As we know, based on the requirements, we need to build a backend API for our application, which
is movie rater.
So we will need to create a Django.
We'll need to also connect a Django rest framework to it and we need to build a few model serializers
URLs and views and that will be it.
And in the next few videos we'll do that together.
So first thing first what we need to do.
I have terminal open here.
I'm inside the desktop here.
I will create a new folder.
So CD.
Movie rater API.
At the moment I'm creating just a folder is sorry.
So what I need to do is mkdir and then movie rater API.
So that's being created.
I need to move to movie rater API now and inside that folder I can create a virtual environment.
We know how to do it already.
So python three m vnf.
Vnf.
We need to activate it.
And this is activated now.
So what we need to do is we need to install our requirements.
So we need to install Django.
We need to pip install Django.
Also, we need to do Django Rest framework.
And that's been installed.
We can also run this command Pip install, upgrade pip.
I suggested.
And we have everything set up for us now.
So let's open this, a new folder, this new application inside our PyCharm.
I will go open.
That's our new folder.
And here we have our application.
So virtual environment is here.
We can do terminal.
You can see it's automatically activated.
So that means it's all working fine.
So what do we need to do is now we need to create a project and an application Django admin start project
and we call it movie creator and we would like to do it in the current folder.
And you can see here movie writer has been created here.
What we also need to do is we need to create an application so Django admin start up and then name of
the application and we can call our application API.
And you can see API is here.
So the reason why I call it API is because we'll have just one kind of application that's very small
application and this will be responsible for our API communication with our front end.
So I call it API and inside here we'll put all our logic, all our models and everything that will be
just exposed API to our front end.
So this is how I call it.
If you have something bigger, maybe it's not a good idea to call it API.
I should split it into three smaller applications, but for our tutorial this is just fine.
So we have that.
Now we can make sure that everything is kind of working, so I will do Python3 Manage.py run server.
And we can make sure it's working fine.
Clicking on this link.
And you can see Django is working.
So all of that is fine.
What we will need to do is what we can do is.
We can try to run this.
So right click, run, manage.
It will fail because there is no configuration yet and we can do edit configuration here and then put
run server.
Here.
And next time, wherever we would like to run the server, we can click it here.
And it will spin up our server.
So what else we need to do?
As you can see here, we have 17 unapplied migrations.
We haven't done any migrations yet and that's built in migration.
As you remember from this settings, we already have some application in our settings.
So all of this admin out and so on that has its own migrations and we need to run this command to apply
them to our database.
So now we'll.
Killed that project.
We can go to terminal.
I can kill that control C and then we can paste python manage.py migrate.
All of that have been added to our database and now we can use our application.
So basically we prepare everything now.
So we have our project, we have our application, we install Django and Django rest framework and it's
ready to be started so we can start building our application from now.