Django Design Patterns and Best Practices Second Edition
暫譯: Django 設計模式與最佳實踐(第二版)

Arun Ravindran

買這商品的人也買了...

商品描述

Build maintainable websites with elegant Django design patterns and modern best practices

Key Features

  • Deep dive into various aspects of Django from Models and Views to testing and deployment
  • Familiarize yourself with the various nuances of web development such as browser attacks and data design
  • Guides you through various asynchronous tools like Celery, Channels.

Book Description

Building secure and maintainable web applications requires extensive knowledge of several areas. This book is not just a guide to tackle such difficult topics beyond Django but also encapsulates years of experience in the form of design patterns and best practices. Rather than stick to GoF design patterns, this book looks broadly at higher-level patterns in web development.

Using the latest version of Django and Python, this book fast track you to current developments like Channels and asyncio while building adequate conceptual background. It compares various design choices that will help you in making everyday decisions in a rapidly changing environment.

You will first learn about various architectural patterns, many of which are used to build Django itself. Start from the very beginnings of a fun superhero project by gathering requirements, creating mockups, and setting up the project. Through project-guided examples, you will explore the Model, View, templates, workflows and code reusability techniques. Throughout this book, you will learn practical Python coding techniques in Django that will enable you to tackle problems related to complex topics like legacy coding, data modelling, code reusability and so on.

You will also explore API design principles and best practices and understand the need for asynchronous workflows in websites. You will also learn popular Python code testing techniques in Django, various web security threats and their countermeasures, and go into the details of monitoring and performance of your application

What you will learn

  • Understand common design patterns that can help you write better Django code
  • Discover the latest best practices and idioms in this rapidly evolving framework
  • Deep dive into various aspects of Django from Models and Views to testing and deployment
  • Get to grips with difficult topics such as dealing with legacy code and debugging
  • Familiarize yourself with the various nuances of web development such as browser attacks and data design
  • Guides you through various asynchronous tools like Celery, Channels and asyncio
  • Shows various patterns while designing an API interface with Django Rest Framework
  • Reduce the maintenance burden with well-tested, cleaner code
  • Show your work to the world by learning about hosting, deploying, and securing your Django projects

Who This Book Is For

The ideal target audience for this book would be Python Developers who are using Python for developing complex web applications and new Django developers who are trying to learn best practices.

商品描述(中文翻譯)

**使用優雅的 Django 設計模式和現代最佳實踐來構建可維護的網站**

#### 主要特點

- 深入探討 Django 的各個方面,從模型(Models)和視圖(Views)到測試和部署
- 熟悉網頁開發中的各種細微差別,例如瀏覽器攻擊和數據設計
- 指導您使用各種非同步工具,如 Celery 和 Channels

#### 書籍描述

構建安全且可維護的網頁應用程序需要對多個領域有廣泛的了解。本書不僅是解決超越 Django 的困難主題的指南,還以設計模式和最佳實踐的形式總結了多年的經驗。本書不僅限於 GoF 設計模式,而是廣泛地考察網頁開發中的高級模式。

本書使用最新版本的 Django 和 Python,快速引導您了解當前的發展,如 Channels 和 asyncio,同時建立足夠的概念背景。它比較了各種設計選擇,幫助您在快速變化的環境中做出日常決策。

您將首先學習各種架構模式,其中許多是用來構建 Django 本身的。從一個有趣的超級英雄項目的最初開始,收集需求、創建模型和設置項目。通過項目引導的範例,您將探索模型(Model)、視圖(View)、模板、工作流程和代碼重用技術。在本書中,您將學習在 Django 中的實用 Python 編碼技術,使您能夠解決與遺留代碼、數據建模、代碼重用等複雜主題相關的問題。

您還將探索 API 設計原則和最佳實踐,並理解網站中非同步工作流程的必要性。您將學習 Django 中流行的 Python 代碼測試技術、各種網頁安全威脅及其對策,並深入了解應用程序的監控和性能。

#### 您將學到什麼

- 理解常見的設計模式,幫助您編寫更好的 Django 代碼
- 發現這個快速發展框架中的最新最佳實踐和慣用語
- 深入探討 Django 的各個方面,從模型(Models)和視圖(Views)到測試和部署
- 理解如何處理遺留代碼和調試等困難主題
- 熟悉網頁開發中的各種細微差別,例如瀏覽器攻擊和數據設計
- 指導您使用各種非同步工具,如 Celery、Channels 和 asyncio
- 在使用 Django Rest Framework 設計 API 接口時展示各種模式
- 通過良好測試的、更乾淨的代碼減少維護負擔
- 通過學習托管、部署和保護您的 Django 項目,向世界展示您的作品

#### 本書適合誰

本書的理想目標讀者是使用 Python 開發複雜網頁應用程序的 Python 開發者,以及試圖學習最佳實踐的新 Django 開發者。