Efficient Python Development in Practice: Django, Tornado, Flask, and Twisted (3rd Edition) cover

Efficient Python Development in Practice: Django, Tornado, Flask, and Twisted (3rd Edition)

No rating yet
Chapters
16
ISBN
9787121416033

Tags

Summary

This is the 3rd edition of the Efficient Python Development in Practice series, written by Liu Changlong. Based on Python 3.8, it systematically explains the four major web frameworks Django 3, Tornado 6, Flask 1.1.2, and Twisted 20. The book is divided into three parts. Part One, "Python Fundamentals," starts from setting up the development environment and covers basic syntax, data types and flow control, functions and exceptions, and object-oriented programming, while filling in the TCP/IP, HTTP, Socket, HTML/CSS/JavaScript/jQuery, and relational database and ORM modeling knowledge needed for web programming. Part Two, "Python Frameworks," first surveys network frameworks and the MVC structure, then explains one by one Django's model layer, view layer, templates and forms, and admin site; Tornado's asynchronous coroutines, RequestHandler, and WebSocket; Flask's routing, contexts, Jinja2 templates, SQLAlchemy, and WTForms; and Twisted's advanced topics such as TCP/UDP programming, deferred calls, and multithreading, also touching on pip, virtualenv, WSGI, and Nginx+uWSGI deployment. Part Three, "Python Framework Practice," links four complete projects: developing a mobile Twitter with Django+PostgreSQL, building a WebSocket chat room with Tornado+jQuery, implementing a school management system with Flask+Bootstrap+RESTful, and realizing a cross-platform IoT message gateway with Twisted+SQLAlchemy+ZeroMQ. The new edition updates the framework versions in sync and emphasizes modern backend development techniques such as asynchronous coroutines, WebSocket communication, and RESTful interfaces.

Editor's review

市面上讲 Python Web 的书多半只盯住一个框架,这本书的价值恰恰在于它对四个主流框架进行横向对比:Django 擅长企业级全栈开发,Tornado 擅长高并发异步处理,Flask 适合快速建站与轻量接口,Twisted 擅长底层自定义协议。把四者放在一起读,就能更清楚地看到它们在路由、模板、ORM、异步模型上的差异,从而知道下一个项目该选哪个。第3版把各框架的版本都更新到较新的主流版本,并且补充了异步协程、WebSocket、RESTful 接口这类近年后端开发的核心话题,避免了旧版内容过时的问题。全书安排了四个完整的实战项目,覆盖移动端社交应用、实时聊天室、学校管理系统和物联网消息网关,项目不大但流程完整。这本书也适合作为高校课程教材。

Who it's for

A good fit for

  • 有 Python 语法基础、想系统入门 Web 后端开发的读者
  • 需要在 Django、Tornado、Flask、Twisted 之间做技术选型的开发者
  • 希望借助完整项目案例理解全栈开发流程的在校学生
  • 想用 Twisted 等框架做协议编程和物联网网关的工程人员

Not a good fit for

  • 完全没有编程经验、需要从零开始学 Python 的初学者
  • 只做前端开发、不涉及服务端与数据库的读者
  • 想深入源码级别的框架原理解读或分布式架构设计的高级工程师

Reading tips

  1. 先读完上篇的基础篇再进入框架篇;如果已有基础,可以按需跳读网络、数据库章节。
  2. 四个框架不要平均用力,建议按当前项目需要精读一个,其余作为对比浏览。
  3. 下篇的四个实战项目建议边读边敲代码,并按书中的项目结构自己搭一遍后再改造。
  4. 动手前先按书中说明确认 Python 与各框架的版本,必要时用 virtualenv 建立独立环境,避免依赖冲突。

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.

Contents

  1. Part One Python Fundamentals
  2. Chapter 1 Basic Python Knowledge
  3. Chapter 2 Network Basics of Web Programming
  4. Chapter 3 Client-Side Programming Techniques
  5. Chapter 4 Databases and ORM
  6. Part Two Python Frameworks
  7. Chapter 5 Overview of Python Network Frameworks
  8. Chapter 6 Enterprise Development Framework—Django
  9. Chapter 7 High-Concurrency Processing Framework—Tornado
  10. Chapter 8 Framework for Rapid Site Building—Flask
  11. Chapter 9 Low-Level Custom Protocol Network Framework—Twisted
  12. Part Three Python Framework Practice
  13. Chapter 10 Practice 1: Developing a Mobile Twitter with Django+PostgreSQL
  14. Chapter 11 Practice 2: Developing a WebSocket Chat Room with Tornado+jQuery
  15. Chapter 12 Practice 3: Developing a School Management System with Flask+Bootstrap+Restful
  16. Chapter 13 Practice 4: Developing a Cross-Platform IoT Message Gateway with Twisted+SQLAlchemy+ZeroMQ

FAQ

这本书有第3版和第1版,应该选哪一个?
第3版(2021年8月,ISBN 9787121416033)基于 Python 3.8,讲解 Django 3、Tornado 6、Flask 1.1.2、Twisted 20,内容和版本都更新;第1版为2016年版,第2版为2019年版,框架版本较旧。新读者优先选第3版。
没有 Web 开发经验能读懂吗?
可以,但需要具备 Python 基本语法。书中上篇从环境搭建、语法基础讲到 HTTP、Socket、HTML/CSS 和数据库,是为 Web 新手补的基础内容。完全零编程经验的读者建议先学一本 Python 入门书。
这本书的四个实战项目需要什么基础?
需要基本的 Python 编程和 SQL 概念。四个项目分别用到 PostgreSQL、jQuery、Bootstrap、SQLAlchemy、ZeroMQ 等组件,书中会给出安装和配置步骤,照着做即可,不需要提前精通这些工具。
读完能用来做企业项目吗?
书中的项目规模偏教学示例,能帮你打通从框架到上线的完整流程,但企业级项目还需要另外补充缓存、消息队列、容器化部署、监控与测试等内容。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

刘长龙 Author

Liu Changlong is an author in the field of artificial intelligence about whom limited public information is available. One work by this author is currently listed: From Machine Learning to Deep Learning: Efficient Development in Practice with scikit-learn and TensorFlow. Judging from the title and its subject classification, the book addresses readers who want to systematically learn development methods in machine learning and deep learning. It centers on two main tools, scikit-learn and TensorFlow, and emphasizes the connection between traditional machine learning and deep learning as well as practical efficiency, reflecting a writing approach oriented toward engineering practice and technical implementation. The author combines tool usage with development workflows, making the book suitable for readers with some programming background who wish to build models hands-on. Beyond this work, no reliable public record of the author's education, career, or research direction is available, so no speculation is offered here.

More by the same author

Top rated in the same category