A Beginner's Guide To Django
A Beginner's Guide To Django
$39.00
Minimum price
$39.00
Suggested price
A Beginner's Guide To Django

This book is 100% complete

Completed on 2020-08-31

About the Book

[Updated 2020.08.31]

1 Python Installation & Test Project

We start by installing Python and creating a simple test project.

2 Virtual Environment

Project dependencies (packages the project depends on) are isolated using a virtual environment.

3 Requirements

Dependencies are installed using requirement files. Each environment gets its own file.

4 Pizzeria Project

Create a new project directory structure and learn about the default configuration files.

5 Settings

Each environment gets its own settings file that configures the project.

6 Environment Variables

Sensitive data (like passwords) are stored as environment variables.

7 PostgreSQL

PostgreSQL database is used in development and production environments.

8 Pages App

Use apps to add new features to the project (home and about page).

9 Bootstrap & Template Inheritance

Add a responsive theme using Bootstrap frontend framework.    

10 Pizzas App

Pizzas app allows users to create, edit, display and delete pizzas.

11 Pizza Model

Pizza model describes how each pizza is stored in the database.

12 Toppings ManyToMany Relationship

Toppings demonstrate how to use ManyToMany relationships.

13 Images

Each pizza can have an image. Smaller thumbnails are generated using the django-imagekit library.

14 Forms

Django's generic class-based editing views makes it easy to create custom forms.

15 Detail Page

Each pizza have its own detail page. SlugField is used to create user-friendly paths (pizzas/quattro-stagioni/).

16 Search With Pagination

Search pizzas with keywords and add a re-usable pagination.

17 Authentication

Add an authentication system that allows users to sign-in and log-in to the site.

18 Permissions

Restrict access to parts of the site using groups and permissions.

19 Static Files (CSS, Sass & JavaScript)

Override Bootstrap styling with your custom CSS and manipulate web pages using JavaScript.

20 Messages & Context Processors

Show temporary messages and display dynamic data on every page.

21 Amazon S3 Storage & CloudFront

Store static files (CSS, images and JavaScript) and user uploaded media (pizza images) in Amazon S3 bucket and serve files using CloudFront (content delivery network).

22 Deployment To Heroku

Deploy the website to Heroku cloud application platform.

23 Extras: Function-based Views (Forms with ModelForm)

Allow visitors to send feedback (and provide a screenshot).

  • Share this book

About the Author

Samuli Natri
Samuli Natri

Programmer.

Table of Contents

  • 1 Python Installation & Test Project
    • 1.1 Python installation
    • 1.2 Test project
  • 2 Virtual Environment
  • 3 Requirements
  • 4 Pizzeria Project
  • 5 Settings
  • 6 Environment Variables
  • 7 PostgreSQL
    • 7.1 macOS installation
    • 7.2 Windows installation
    • 7.3 Creating a database
    • 7.4 Settings
  • 8 Pages App
  • 9 Bootstrap & Template Inheritance
    • 9.1 Base template
    • 9.2 Pages
  • 10 Pizzas App
    • 10.1 URL
    • 10.2 View
    • 10.3 Template
  • 11 Pizza Model
    • 11.1 Listing pizzas
    • 11.2 Queryset
    • 11.3 Grid
  • 12 Toppings ManyToMany Relationship
  • 13 Images
    • 13.1 Thumbnails
  • 14 Forms
  • 15 Detail Page
  • 16 Search With Pagination
    • 16.1 Search
    • 16.2 Pagination
  • 17 Authentication
    • 17.1 Allauth
    • 17.2 Template files
  • 18 Permissions
    • 18.1 Groups
    • 18.2 Access restrictions
    • 18.3 Checking permissions
  • 19 Static Files (CSS, Sass & JavaScript)
    • 19.1 CSS
    • 19.2 Sass
    • 19.3 JavaScript
  • 20 Messages & Context Processors
    • 20.1 Messages
    • 20.2 Context processors
  • 21 Amazon S3 Storage & CloudFront
    • 21.1 Creating an Administrator user
    • 21.2 Creating a Pizzeria user
    • 21.3 Creating an Amazon S3 bucket
    • 21.4 CloudFront
    • 21.5 Configuration
  • 22 Deployment To Heroku
    • 22.1 Creating a new app
    • 22.2 Configuring Heroku
    • 22.3 Heroku command line tools
    • 22.4 Procfile and requirements
    • 22.5 Settings
    • 22.6 Git
    • 22.7 Deploy
    • 22.8 Updating the production site
  • 23 Extras: Function-based Views (Forms with ModelForm)
    • 23.1 Feedback app
    • 23.2 Model
    • 23.3 URLs
    • 23.4 Forms
    • 23.5 Views
    • 23.6 Templates

Authors have earned$9,411,989writing, publishing and selling on Leanpub,
earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub