Django Day 2

creating our first project

Siddhant"Wang"
3 min readMar 30, 2023

Welcome to Day 2 of learning Django! In case you missed it, you can find the link to my previous tutorial here. Today, we will be creating our very first Django web project.

now lets start with our today’s work.

Photo by elnaz asadi on Unsplash

Creating our first project

Step 1: Setting the location path and creating a directory

As a Windows user, we need to access Windows PowerShell again. You can do this by right-clicking on the Windows icon and choosing Windows PowerShell. You can create your project in any directory you want. If you want to change the directory, use the following code:

Set-Location -Path E: 

For example, I created a folder called “Djj” in my E drive, and then created another folder called “learning” inside it. To change into that directory, we use the ‘cd’ command:

cd .E\Djj\

Type ‘ls’ command to see how many files we have in the “learning” folder. Then, use the django-admin command to see all the commands used in Django.

Step 2: Creating our Django web project

To create our web project, we use the following command:

Where “mysite” is the name of our website. Now, change into the “mysite” directory using the following command:

You should see the manage.py file in that directory. To deploy our web app on our local host and see if it works, type the following command:

python manage.py runserver

You should see the following outputs,

Step 3: Deploying at our local server

As you can see in the following window, there’s a line that says “Starting development server at https://127.0.0.1:8000/". Click or paste that https link in your browser, and you will see the following page:

Congratulations! You have successfully deployed your first web project!

I hope you have understood todays tutorial, in case you haven't you can check out the same video I am following. Click here.

I hope you found today’s tutorial helpful. In case you need further clarification, you can check out the same video tutorial I’m following from CodeWithHarry’s playlist. Click here to access it.

Happy learning!

--

--