Module 1
Getting Started
Step 1: Installation Installation
Install Python:
Download from,
[Link]
Install: execute installer
Verify: python OR python -V
Install VSCode:
Download from,
[Link]
Install pip:
Open VSCode IDE
Go to extension, search for pip manager and install
Install django:
Open VSCode IDE
Open new terminal
pip install django
Installation
Step 2: Django Project
Create a New Django Project:
django-admin startproject myproject
Verify Django project:
cd myproject
Execute code:
python [Link] runserver
Installation
Step 3: Set execution policy
Goto windows powershell
On cammand prompt execute command
set-executionpolicy remotesigned
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default
is "N"): A
If showing warning message
set-executionpolicy –scope CurrentUser remotesigned –Force
Installation
Step 4: Virtual environment
Create a Virtual Environment
python -m venv env
Activate the Virtual Environment
env\Scripts\activate
Install Django in the Virtual Environment
pip install django
Install other packages in the Virtual Environment
pip install ……………
Installation
Step 1: Installation
We will install the following dependencies and modules before starting our setup:
Install Python
Install pip
Install Virtualenv Step 8: Execution Policy Change
pip install virtualenv set-executionpolicy remotesigned
Step 2: Create a New Directory for your Django Project [Y] Yes [A] Yes to All [N] No [L] No to All
mkdir my_django_project [S] Suspend [?] Help (default is "N"): A
cd my_django_project set-executionpolicy –scope CurrentUser
remotesigned -Force
Step 3: Create a Virtual Environment
python -m venv env
Step 9: Set path
Step 4: Activate the Virtual Environment Inside myproject directory”
venv\ Scripts\ activate python [Link] shell
Step 5: Install Django in the Virtual Environment
pip install django
Step 6: Create a New Django Project
django-admin startproject myproject
Step 7: Verify your Django Installation
cd myproject