Chapter 2. Django Quick Start

Install Python

Django is a Python-based web framework, so you must have Python on your computer. Depending on your computer's OS, Python may be already pre-installed; however, Python has several versions. It is better to use the latest version unless you have a specific reason to use older versions.

For Mac OS mac.svg and Windows OS windows.svg

Download and install Python from the official site

You can download the latest Python from the Python's official site .

1. Go to the official Python site and select your OS under Downloads.

Install-Python

2. Install Python and check the installed version

For Macmac.svg

Downloads pkg file

Install-Python

Open the pkg file and follow the instructions

Install-Python

Move the installer to Trash

Install-Python

Check the installed version

Run the python3 --version command. As the latest version of Python is version 3, you need to type python3.

Command Line - INPUT
python3 --version
Command Line - RESPONSE
Python 3.11.2

For Windowswindows.svg

Download the exe file

Install-Python

Install Python

Make sure you check "Add python.exe to PATH". If you don't check this, your command line may not recognize that Python is installed.

Install-Python

Note: If you may use a long file path, click Disable path length limit before closing the popup.

Install-Python

Check the installed version

Run the python --version command. For Windows, you don't need to use python3.

Command Line - INPUT
python --version
Command Line - RESPONSE
Python 3.11.2

For Linux OS linux.svg

Install Python using a package manager in the command line

If you are using the CUI environment, you need to use a package manager command. For example, run the following commands for ubuntu Linux OS.

Command Line - INPUT
sudo apt update
sudo apt install python3

Django is a Python-based web framework, so you must have Python on your computer. Depending on your computer's OS, Python may be already pre-installed; however, Python has several versions. It is better to use the latest version unless you have a specific reason to use older versions.

For Mac OS mac.svg and Windows OS windows.svg

Download and install Python from the official site

You can download the latest Python from the Python's official site .

1. Go to the official Python site and select your OS under Downloads.

Install-Python

2. Install Python and check the installed version

For Macmac.svg

Downloads pkg file

Install-Python

Open the pkg file and follow the instructions

Install-Python

Move the installer to Trash

Install-Python

Check the installed version

Run the python3 --version command. As the latest version of Python is version 3, you need to type python3.

Command Line - INPUT
python3 --version
Command Line - RESPONSE
Python 3.11.2

For Windowswindows.svg

Download the exe file

Install-Python

Install Python

Make sure you check "Add python.exe to PATH". If you don't check this, your command line may not recognize that Python is installed.

Install-Python

Note: If you may use a long file path, click Disable path length limit before closing the popup.

Install-Python

Check the installed version

Run the python --version command. For Windows, you don't need to use python3.

Command Line - INPUT
python --version
Command Line - RESPONSE
Python 3.11.2

For Linux OS linux.svg

Install Python using a package manager in the command line

If you are using the CUI environment, you need to use a package manager command. For example, run the following commands for ubuntu Linux OS.

Command Line - INPUT
sudo apt update
sudo apt install python3