How to create a Django environment and run your  Django project

How to create a Django environment and run your Django project

In order to create an environment for your django project, you will have to go through some steps.

Step1: The first step is to go to the command prompt , you can search for that on the search bar. image1.png Step2: In the command prompt, check if you have python installed on your local machine. if not make sure you install the latest version of python.
[python.org/downloads/]

python  --version

image2.png Step3 Navigate to the directory/Folder you want to create your Django Project. I am creating my Fjango project in the desktop and in a folder called first_project, you can choose to name your folder anything just make it clear and descriptive.

cd desktop
mkdir first_project

image4.png Step4 Navigate into the folder you created

cd first_project

image6.png

Step5 Create your virtual environment. (it might take long depending on your internet connection)

python -m venv env

image7.png

Step 6 Activate your virtual environment

env\Scripts\activate

image8.png

Step 7 Install the latest version of Django an create a Django project. Your Django project can be any name.

pip install django
django-admin startproject my_project

image9.png

Note: You can also create an app for the Django project. Again you can choose to name your app anything. Just make it clear and descriptive.

python manage.py startapp

image10.png

Step 8 Finally you run your server

python manage.py runserver

image11.png

Step 9 Copy the port number and paste in your chrome browser Screenshot (58).png

Congratulations you have successfully installed your Django project