1. Installing Python:
- Download Python:
- Go to the official Python website: python.org.
- Navigate to the Downloads section and download the latest version of Python for your operating system (Windows, macOS, or Linux).
- Install Python:
- Once the download is complete, run the installer.
- Make sure to check the box that says “Add Python to PATH” during the installation process.
- Click on “Install Now” to complete the installation.
- Verify Installation:
- Open a command prompt (on Windows) or terminal (on macOS or Linux).
- Type
python --version
orpython3 --version
and press Enter. - You should see the installed Python version printed, confirming that Python is installed correctly.
2. Installing Django:
- Install Django using pip:
- Open a command prompt or terminal.
- Type
pip install django
and press Enter. - Pip is the package installer for Python, and it will download and install Django and its dependencies.
- Verify Django Installation:
- After installation, you can verify Django by typing
pip show django
in the command prompt or terminal. - You should see the installed Django version printed, confirming that Django is installed correctly.
3. Installing Visual Studio Code (VS Code):
- Download VS Code:
- Go to the official Visual Studio Code website: code.visualstudio.com.
- Click on the Download for [Your Operating System] button to download the installer.
- Install VS Code:
- Run the downloaded installer.
- Follow the installation wizard instructions.
- During installation, you can choose options like adding VS Code to the PATH for easy access from the command line.
- Open VS Code:
- After installation, open Visual Studio Code.
- You can open VS Code from the Start Menu (Windows), Applications folder (macOS), or from the installed directory (Linux).
Demonstrating the Installation:
- Once everything is installed:
- Open VS Code.
- Create a new folder for your Django project.
- Open this folder in VS Code.
- Open a terminal in VS Code (
Ctrl +
orCmd +
) and start a new Django project by runningdjango-admin startproject myprojectname
. - Navigate into the project folder and start the Django development server with
python manage.py runserver
. - You can now access your Django application by visiting
http://localhost:8000
in your web browser.