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 for the Impatient
  • Table Of Contents Toc
Django 5 for the Impatient

Django 5 for the Impatient - Second Edition

By : Daniel Correa, Greg Lim
4 (1)
close
close
Django 5 for the Impatient

Django 5 for the Impatient

4 (1)
By: Daniel Correa, Greg Lim

Overview of this book

Learning Django can be a challenging and time-consuming activity without the right guidance. With hundreds of tutorials, loads of documentation, and unclear explanations out there, it’s easy to lose sight of what’s most important. This book stands out by teaching you how to use Django in just a few days with a focused approach. In this second edition, you’ll go on a fun, practical, and pragmatic journey to learning full-stack development with Django 5. You’ll start building your first Django app within minutes. As you progress, you’ll learn from concise explanations that will help you get to grips with some of the most important Django features, including URLs, views, templates, models, CSS inclusion, image storage, Django admin panel, and more. You’ll also understand how to design Django MVT (Model-View-Template) architectures and implement them. Additionally, you’ll use Django to develop a movie store application and deploy it to the internet. By the end of this book, you’ll be able to build and deploy your own Django web applications confidently.
Table of Contents (16 chapters)
close
close

Introducing and installing Django

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design (https://www.djangoproject.com/). Django makes it easier to build better web apps more quickly and with less code.

There are several ways to install Django; we will use pip to install Django in this book. pip is the standard package manager for Python to install and manage packages not part of the standard Python library. pip is automatically installed if you downloaded Python from https://www.python.org/.

First, check whether you have pip installed by going to the Terminal and running the following commands:

  • For macOS, run this:
    pip3
  • For Windows, run this:
    pip

If you have pip installed, the output should display a list of pip commands, as shown in Figure 1.3:

Figure 1.3 – Checking whether pip is installed on Windows

Figure 1.3 – Checking whether pip is installed on Windows

Next, to install Django, run the following commands:

  • For macOS, run this:
    pip3 install django==5.0
  • For Windows, run this:
    pip install django==5.0

The preceding command will retrieve the Django 5.0 code version and install it on your machine. Note that there may be newer versions available when you’re reading this book. However, we recommend continuing to use Django 5.0 to ensure that the code in this book will function correctly. After installation, close and reopen your Terminal.

To check whether you have installed Django, run the following commands.

  • For macOS, run this:
    python3 -m django
  • For Windows, run this:
    python -m django

Now, the output will show you all the Django commands you can use, as shown in Figure 1.4:

Figure 1.4 – The Django module commands on macOS

Figure 1.4 – The Django module commands on macOS

Over the course of the book, you will progressively be introduced to some of the preceding commands.

Note

It is also common to use virtual environments (such as the venv module) to manage your Python and Django projects and dependencies. For now, we will not use venv to get started quickly on Django. We will learn how to use and configure venv at the end of this book.

We have all the tools we need to create a Django project. Now, let’s move on to doing that.

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 for the Impatient
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