Open this folder in VS Code.
Open a New Terminal (Terminal > New)
Enter the following to create the Virtual Environment named .django-venv
py -3 -m venv .django-venv
Click Yes to select this as the workspace folder.
Press Win+Shift+P to open the Command Palette (View > Command Palette).
Search for Python: Select Interpretor
Choose use Python from the default path.
Start a new Terminal with the Virtual Environment active.
You should see (.django-venv) before the folder if it is active.
Upgrade pip first if needed.
python -m pip install --upgrade pip
Next install the Django framework.
python -m pip install django
By default a django project has some core files and a django administration panel.
We use django-admin for this.
In the terminal run the following code, this will create a django app/project called example_web_project. Change this to the name of your project.
django-admin startproject example_web_project
This will create some core files for the project.
Create an empty database by entering the following command
python manage.py migrate
You should see some installation messages.
To run the server enter the following line into the terminal:
python manage.py runserver
You should see this message:
When you visit the page you will see:
Congratulations, you have now installed and setup django.
Later lessons will customise this website.