Django 2 Web Development Cookbook: 100 practical recipes on building scalable Python web apps with Django 2, 3rd Edition
暫譯: Django 2 網頁開發食譜:100 個實用食譜,使用 Django 2 建立可擴展的 Python 網頁應用程式(第三版)

Jake Kronika, Aidas Bendoraitis

商品描述

Create unbelievably fast, robust and secure web apps with Django Web Framework and Python 3.8

Key Features

  • Discover solutions to a variety of web application scenarios, leveraging the power of the Django framework
  • Understand URL routing, models, forms, templates, and RESTful services with Django 2.14
  • Test, deploy, and scale your web applications efficiently with Amazon Web Services

Book Description

Django is a framework designed to balance rapid web development with high performance. It handles high levels of user traffic and interaction, integrates with a variety of databases, and collects and processes data in real time. This book follows a task-based approach to guide you through developing with the Django 2.1 framework, starting with setting up and configuring Docker containers and a virtual environment for your project.

You'll learn how to write reusable pieces of code for your models and manage database changes. You'll work with forms and views to enter and list data, applying practical examples using templates and JavaScript together for the optimum user experience. This cookbook helps you to adjust the built-in Django administration to fit your needs and sharpen security and performance to make your web applications as robust, scalable, and dependable as possible. You'll also explore integration with Django CMS, the popular content management suite.

In the final chapters, you'll learn programming and debugging tricks and discover how collecting data from different sources and providing it to others in various formats can be a breeze. By the end of the book, you'll learn how to test and deploy projects to a remote dedicated server and scale your application to meet user demands.

What you will learn

  • Get started with the basic configuration necessary to start any Django project
  • Build a database structure out of reusable model mixins
  • Secure web applications against malicious usage and address common performance bottlenecks
  • Integrate with, and extend, the Django CMS
  • Construct and manage complex and deep hierarchies
  • Import data from local sources and external web services and export it to third parties

Who this book is for

This book is designed for Python developers working on fast and secure web apps that can scale over time. You'll also find this book useful if you want to upgrade to latest Django framework. A background in Python 3 along with basic knowledge of the Django framework will be useful.

Table of Contents

  1. Getting Started with Django 2.1
  2. Database Structure and Modeling
  3. Forms and Views
  4. Templates and JavaScript
  5. Custom Template Filters and Tags
  6. Model Administration
  7. Security and Performance
  8. Django CMS
  9. Hierarchical Structures
  10. Importing and Exporting Data
  11. Bells and Whistles
  12. Testing and Deployment

商品描述(中文翻譯)

**使用 Django 網頁框架和 Python 3.8 創建令人難以置信的快速、穩健和安全的網頁應用程式**

#### 主要特點

- 探索各種網頁應用程式場景的解決方案,利用 Django 框架的強大功能
- 理解 URL 路由、模型、表單、模板和 Django 2.14 的 RESTful 服務
- 使用 Amazon Web Services 高效測試、部署和擴展您的網頁應用程式

#### 書籍描述

Django 是一個旨在平衡快速網頁開發與高性能的框架。它能處理高水平的用戶流量和互動,與各種數據庫集成,並實時收集和處理數據。本書採用任務導向的方法,指導您使用 Django 2.1 框架進行開發,從設置和配置 Docker 容器及虛擬環境開始。

您將學習如何為模型編寫可重用的代碼片段並管理數據庫變更。您將使用表單和視圖來輸入和列出數據,並結合模板和 JavaScript 應用實用範例,以獲得最佳的用戶體驗。本食譜幫助您調整內建的 Django 管理界面以符合您的需求,並加強安全性和性能,使您的網頁應用程式盡可能穩健、可擴展和可靠。您還將探索與流行的內容管理套件 Django CMS 的集成。

在最後幾章中,您將學習編程和除錯技巧,並發現從不同來源收集數據並以各種格式提供給他人是多麼輕鬆。到書籍結束時,您將學會如何測試和部署項目到遠端專用伺服器,並擴展您的應用程式以滿足用戶需求。

#### 您將學到的內容

- 開始進行任何 Django 項目所需的基本配置
- 建立可重用模型混合的數據庫結構
- 保護網頁應用程式免受惡意使用並解決常見性能瓶頸
- 與 Django CMS 集成並擴展其功能
- 構建和管理複雜且深層的層級結構
- 從本地來源和外部網路服務導入數據並導出給第三方

#### 本書適合誰

本書專為從事快速且安全的網頁應用程式開發的 Python 開發者設計,這些應用程式能隨著時間的推移而擴展。如果您想升級到最新的 Django 框架,這本書也會對您有幫助。具備 Python 3 的背景以及對 Django 框架的基本知識將會很有用。

#### 目錄

1. 開始使用 Django 2.1
2. 數據庫結構和建模
3. 表單和視圖
4. 模板和 JavaScript
5. 自定義模板過濾器和標籤
6. 模型管理
7. 安全性和性能
8. Django CMS
9. 層級結構
10. 數據的導入和導出
11. 附加功能
12. 測試和部署