Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Django 5 By Example
  • Table Of Contents Toc
  • Feedback & Rating feedback
Django 5 By Example

Django 5 By Example - Fifth Edition

By : Antonio Melé
4.6 (36)
close
close
Django 5 By Example

Django 5 By Example

4.6 (36)
By: Antonio Melé

Overview of this book

If you want to learn Django by doing, this book is for you. This 2025 EDITION, fully updated to Django 5.2 LTS, is the fifth edition of the best-selling Django By Example franchise that helps you build real-world web apps. This book will walk you through planning and creation, solving common problems, and implementing best practices using a step-by-step approach. You’ll cover a wide range of web application development topics through four different projects: a blog application, a social website, an e-commerce application, and an e-learning platform. Pick up what’s new in Django 5 as you build end-to-end Python web apps, follow detailed project plans, and understand the hows and whys of Django. This is a practical and approachable book that will have you creating web apps quickly.
Table of Contents (20 chapters)
close
close
18
Other Books You May Enjoy
19
Index

Installing Python

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

If you’re using Linux or macOS, you probably have Python installed, but you may need to upgrade to one of the supported versions just mentioned. You can download the installer by visiting python.org/downloads. Alternatively, use your preferred method for installing one of the latest versions. If you’re using Windows, you can also download a Python installer from the Python website.

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.9

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.

On 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.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Django 5 By Example
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon