Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Django 3 Web Development Cookbook

You're reading from   Django 3 Web Development Cookbook Actionable solutions to common problems in Python web development

Arrow left icon
Product type Paperback
Published in Mar 2020
Publisher Packt
ISBN-13 9781838987428
Length 608 pages
Edition 4th Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Jake Kronika Jake Kronika
Author Profile Icon Jake Kronika
Jake Kronika
Aidas Bendoraitis Aidas Bendoraitis
Author Profile Icon Aidas Bendoraitis
Aidas Bendoraitis
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Getting Started with Django 3.0 2. Models and Database Structure FREE CHAPTER 3. Forms and Views 4. Templates and JavaScript 5. Custom Template Filters and Tags 6. Model Administration 7. Security and Performance 8. Hierarchical Structures 9. Importing and Exporting Data 10. Bells and Whistles 11. Testing 12. Deployment 13. Maintenance 14. Other Books You May Enjoy

To get the most out of this book

To develop with Django 3.0 using the examples in these pages, you will need the following:

  • Python 3.6 or higher
  • The Pillow library for image manipulation
  • Either the MySQL database and the mysqlclient binding library, or the PostgreSQL database with the psycopg2-binary binding library
  • Docker Desktop or Docker Toolbox for complete system virtualization, or a built-in virtual environment to keep each project's Python modules separated
  • Git for version control
Software/hardware covered in the book OS recommendations

Python 3.6 or higher
Django 3.0.X
PostgreSQL 11.4 or higher/MySQL 5.6 or higher

Any recent Unix-based operating system, such as macOS or Linux (although it is possible to develop on Windows too)

All other specific requirements are mentioned separately in each recipe.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copy/pasting of code or incorrect indentation.

For editing project files you can use any code editor, but we recommend PyCharm (https://www.jetbrains.com/pycharm/) or Visual Studio Code (https://code.visualstudio.com/).

I would be thrilled if, after successfully publishing your Django project, you would share your results, learnings, and outcomes with me by email at aidas@bendoraitis.lt.

All code examples have been tested using Django 3. However, they should work with future version releases as well.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Django-3-Web-Development-Cookbook-Fourth-Edition. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "For this recipe to work, you will need to have the contenttypes app installed."

A block of code is set as follows:

# requirements/dev.txt
-r _base.txt
coverage
django-debug-toolbar
selenium

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

class Idea(CreationModificationDateBase, MetaTagsBase, UrlBase):
title = models.CharField(
_("Title"),
max_length=200,
)
content = models.TextField(
_("Content"),
)

Any command-line input or output is written as follows:

(env)$ pip install -r requirements/dev.txt

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "We can see here that the upload-related action buttons are also replaced with a Remove button."

Warnings or important notes appear like this.
Tips and tricks appear like this.
lock icon The rest of the chapter is locked
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.
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 $19.99/month. Cancel anytime