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 and Windows OS
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.
2. Install Python and check the installed version
For Mac
1) Downloads pkg file
2) Open the pkg file and follow the instructions
3) Move the installer to Trash.
4) Check the installed version
5) Run the python3 --version
command. As the latest version of Python is version 3, you need to type python3
.
python3 --version
Python 3.11.2
For Windows
1) Download the exe file.
2) 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.
Note: If you may use a long file path, click Disable path length limit before closing the popup.
3) Check the installed version.
4) Run the python --version
command. For Windows, you don't need to use python3
.
python --version
Python 3.11.2
For Linux OS
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.
sudo apt update
sudo apt install python3