Reader small image

You're reading from  Django 5 By Example - Fifth Edition

Product typeBook
Published inApr 2024
PublisherPackt
ISBN-139781805125457
Edition5th Edition
Right arrow
Author (1)
Antonio Melé
Antonio Melé
author image
Antonio Melé

Antonio Melé has been crafting Django projects since 2006, for clients spanning multiple industries. He is Engineering Director at Backbase, a leading global fintech firm dedicated to facilitating the digital transformation of financial institutions. He co-founded Nucoro, a digital wealth management platform. In 2009 Antonio founded Zenx IT, a company specialized in developing digital products. He has been working as CTO and consultant for several tech-centric startups. He has also managed development teams building projects for large enterprise clients. He has an MSc in Computer Science from Universidad Pontificia Comillas and completed the Advanced Management Program at MIT Sloan. His father inspired his passion for computers and coding.
Read more about Antonio Melé

Right arrow

Installing Python

Django 5.0 supports Python 3.10, 3.11, and 3.12. In the examples in this book, we will use Python 3.12.

If you’re using Linux or macOS, you probably have Python installed. If you’re using Windows, you can download a Python installer from the python.org website. You can download Python for your OS from https://www.python.org/downloads/.

Open the command-line shell prompt of your machine. If you are using macOS, press Command + spacebar to open Spotlight and write Terminal to open Terminal.app. If you are using Windows, open the Start menu and type powers into the search box. Then, click on the Windows PowerShell application to open it. Alternatively, you can use the more basic command prompt by typing cmd into the search box and clicking on the Command Prompt application to open it.

Verify that Python 3 is installed on your machine by typing the following command in the shell prompt:

python3 --version

If you see the following, then Python 3 is installed on your computer:

Python 3.12.3

If you get an error, try the python command instead of python3. If you use Windows, it’s recommended that you replace python with the py command.

If your installed Python version is lower than 3.12, or if Python is not installed on your computer, download Python 3.12 from https://www.python.org/downloads/ and follow the instructions to install it. On the download site, you can find Python installers for Windows, macOS, and Linux.

Throughout this book, when Python is referenced in the shell prompt, we will use the python command, though some systems may require using python3. If you are using Linux or macOS and your system’s Python is Python 2, you will need to use python3 to use the Python 3 version you installed. Note that Python 2 reached end-of-life in January 2020 and shouldn’t be used anymore.

In Windows, python is the Python executable of your default Python installation, whereas py is the Python launcher. The Python launcher for Windows was introduced in Python 3.3. It detects what Python versions are installed on your machine and it automatically delegates to the latest version.

If you use Windows, you should use the py command. You can read more about the Windows Python launcher at https://docs.python.org/3/using/windows.html#launcher.

Next, you are going to create a Python environment for your project and install the necessary Python libraries.

Previous PageNext Page
You have been reading a chapter from
Django 5 By Example - Fifth Edition
Published in: Apr 2024Publisher: PacktISBN-13: 9781805125457
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Antonio Melé

Antonio Melé has been crafting Django projects since 2006, for clients spanning multiple industries. He is Engineering Director at Backbase, a leading global fintech firm dedicated to facilitating the digital transformation of financial institutions. He co-founded Nucoro, a digital wealth management platform. In 2009 Antonio founded Zenx IT, a company specialized in developing digital products. He has been working as CTO and consultant for several tech-centric startups. He has also managed development teams building projects for large enterprise clients. He has an MSc in Computer Science from Universidad Pontificia Comillas and completed the Advanced Management Program at MIT Sloan. His father inspired his passion for computers and coding.
Read more about Antonio Melé