DAY 4 OF LEARNING DJANGO.



This content originally appeared on DEV Community and was authored by Chemutai Brenda

DJANGO STRUCTURE.

Today i learnt how to do a set for creating a project using Django.

Step 1:
Set up
Creating a programming environment
I open a folder in my installed text editor(VS Code) and runed the following command in the terminal to create an environment called env.:

  python -m venv env

Inside the terminal, I used the following command to activate the environment:

.env/Scripts/activate

STEP 2:
Installing Django

I used the following command in the newly created environment to install Django.

pip install django

STEP 3:
Starting my project.

To start my project i run the following command in the vs code terminal to generate root directory with project name, which in this case is called “MyProject”.

django-admin startproject myproject

STEP 4:

After creating MyProject root directory, there is another directory called MyProject, just as the project name.
This other directory contains the project-wide settings and configurations.

Image description


This content originally appeared on DEV Community and was authored by Chemutai Brenda