WEBVTT

00:02.090 --> 00:05.330
Okay, let's start our first project with Django.

00:05.360 --> 00:09.660
I have removed the previous virtual environment and start started from scratch.

00:09.680 --> 00:16.310
We'll create a new folder so mkdir create a directory and then we can name it.

00:16.520 --> 00:25.490
For example tutorial two torial and then you can see here folder has been created.

00:25.490 --> 00:32.990
I will go into that tutorial folder and then we'll create a virtual environment the same way we've done

00:32.990 --> 00:33.800
it before.

00:37.570 --> 00:39.190
We know how to do it already.

00:39.220 --> 00:40.510
It will take a while.

00:40.540 --> 00:41.710
I will activate it now.

00:41.740 --> 00:45.790
Source Venv bin Activate.

00:45.940 --> 00:47.770
And then that's been activated.

00:47.770 --> 00:53.020
So inside here you can see we have virtual environment inside.

00:53.050 --> 00:58.840
So what we need to do is pip install Django.

00:59.260 --> 01:03.820
So in order to create a Django project, we need to have Django installed.

01:03.820 --> 01:11.680
And I'm inside the virtual environment here, so this chunk will be inside installed inside that folder.

01:11.680 --> 01:17.170
So to make sure we can go into our environment, you can see here libraries.

01:17.970 --> 01:23.250
Python site packages and Django has been installed in this folder.

01:23.910 --> 01:24.300
Okay.

01:24.300 --> 01:27.620
Once we have Django, we can use Django code command.

01:27.630 --> 01:28.860
So Django.

01:29.550 --> 01:30.570
Django.

01:32.050 --> 01:43.990
Uh, let me do more space clear Django admin and then we'll do start project altogether.

01:43.990 --> 01:51.760
And then you can name your project, let's say do first project, and then I will do space and comma.

01:51.790 --> 01:54.910
That means we would like to do it in the current folder.

01:54.910 --> 02:00.250
So I will do Django admin Django admin start project altogether.

02:00.250 --> 02:03.340
Name of our project and then dot.

02:04.210 --> 02:09.460
So if I go here you can see here the first has been created.

02:09.460 --> 02:14.950
That's my new project and that's managed by the that file has been created for us.

02:14.950 --> 02:22.000
That's a Python script and we'll use that file to run a lot of commands and I will show you how to do

02:22.000 --> 02:23.530
it later on.

02:23.530 --> 02:28.630
And then we have virtual environment, the one we've created before.

02:28.630 --> 02:33.380
So basically now I can start using our projects.

02:33.380 --> 02:35.060
So let's see how we can do this.

02:35.060 --> 02:38.690
Now if I do.

02:38.690 --> 02:42.200
LS You can see Manage.py is available here.

02:42.200 --> 02:49.160
So what I can do is I can do Python3 Manage.py.

02:52.730 --> 02:59.780
And I will explain you in a later video how we can use that manage.py and how we can run that command

02:59.780 --> 03:01.130
more automatically.

03:01.160 --> 03:06.440
At the moment, I'm just trying to run this command and you will see what will happen.

03:11.170 --> 03:16.300
So you can see here development server has been started for me.

03:17.330 --> 03:23.310
Let's open our browser and I will go to this URL.

03:23.330 --> 03:33.890
So at the at the URL 127 0.01 on port 8000, we have our Django application running the install worked

03:33.890 --> 03:34.580
successfully.

03:34.580 --> 03:35.780
Congratulations.

03:35.780 --> 03:40.970
So we see our Django and this is based on the Django 2.2.

03:41.000 --> 03:44.780
So what happened here we.

03:45.350 --> 03:46.130
Did.

03:47.400 --> 03:48.540
This command.

03:48.840 --> 03:58.560
We created a project we call it first, and then we use this new file, Manage.py, to run our server.

03:58.560 --> 04:03.760
So I use Python Manage.py this file here and run server.

04:03.760 --> 04:07.800
And that server started and it's serving on that URL.

04:07.800 --> 04:13.440
So if you copy that URL inside the browser you will see your application running.

04:13.440 --> 04:16.680
So from this moment we have our Django application.

04:16.680 --> 04:20.790
It doesn't do much at this point, but that's a good starting point.

04:20.820 --> 04:24.660
In the next video I will show you how to create an application.

04:24.690 --> 04:32.250
Also will start to go into the code and we'll need to have some kind of ID for doing this.

04:32.250 --> 04:35.580
So I'll explain you everything in the next videos.
