Python Web Development in Practice cover

Python Web Development in Practice

Rating 4.1
Word count
616 words
Chapters
15
ISBN
9787121297335

Tags

Summary

This book unfolds along the journey of a web product from nothing to existence, from simple to complex, and from basic to advanced, covering Python web development from many angles and in depth. Topics include choosing and using web frameworks, databases and ORM, caching, REST and Ajax, website architecture, system administration, testing and continuous integration, message queues and Celery, service-oriented architecture and microservices, data processing, concurrent programming, advanced Python techniques, and web project practice, presenting the complete process of a website project from development to launch. The book devotes particular attention to the Flask framework: from routing, configuration, templates (Jinja2 and Mako), and blueprints to the context mechanism, and on to mainstream extensions such as Flask-Script, Flask-Migrate, Flask-WTF, Flask-Security, Flask-RESTful, and Flask-Admin, all illustrated through real cases such as a file-hosting service, helping readers grasp the essence of using the framework. In addition, popular tools and technologies such as Celery, Jupyter, Supervisor, SaltStack, Pandas, Gevent, and asyncio are explained in some detail and can serve as references for technology selection. The entire book is based on the author's practical engineering experience at Douban; it explains not only "how to use" but also "why use it this way" and common practical problems, making it a desk reference for Python web engineers building a complete knowledge system.

Editor's review

这本书最难得的地方,是它把「Python Web开发」当作一件工程事来讲,而不是只教人写几行Flask路由。全书沿着一个Web产品从无到有、从简单到复杂的脉络铺陈:先讨论为什么用Python、怎么选框架,再动手搭环境、写Flask应用,然后进入数据库、缓存、REST、部署、监控、持续集成、消息队列、服务化、数据处理,最后落到项目结构与代码质量。读者跟着走一遍,就能建立起对网站工程全貌的完整认知。 作者董伟明当时是豆瓣高级产品开发工程师,书中内容多来自豆瓣读书、电影、音乐等产品线的实战积累,因此诸如Nginx与WSGI容器怎么配合、MongoDB与Redis的经验教训、Celery队列与优先级的取舍、代码评审的标准,都带着一线工程的气息,而非教科书式的罗列。 当然要提醒一句:本书出版于2016年,代码以Python 2、Python 3.5、Flask 0.x与早期Celery为主,不少库早已大版本更迭。把它当作技术地图与工程思路的参考,遇到具体API时对照新版官方文档,收获会最大。

Who it's for

A good fit for

  • 有Python基础、准备用Flask等框架做Web应用的后端开发者
  • 做运维或运维开发、希望理解Web应用部署与监控的工程师
  • 需要了解Web工程全流程、便于和开发协作的产品与测试人员
  • 想从脚本/数据分析方向扩展到Web服务的Python使用者

Not a good fit for

  • 完全零编程基础的入门读者,书中默认已掌握Python语法与Linux基本操作
  • 只想学Django或前端框架(React/Vue)的读者,本书以Flask为主
  • 需要严格对照Python 3.10以上与最新生态版本写代码的读者

Reading tips

  1. 先读第1—3章并跟着敲一遍示例,把环境与Flask基本用法打牢,再按兴趣跳读后续章节
  2. 第6—10章的架构、部署与消息队列部分建议结合实际项目阅读,边查官方文档边验证
  3. 遇到书中Python 2写法或老版本API时,以官方最新文档为准做迁移对照,不要照抄
  4. 把第15章的项目结构与代码质量工具当作自查清单,读完后再回头梳理自己的项目

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. Chapter 1 Getting Started with Python Web Development
  2. Chapter 2 Preparation Before Web Development
  3. Chapter 3 Flask Web Development
  4. Chapter 4 Advanced Flask Development
  5. Chapter 5 REST and Ajax
  6. Chapter 6 Website Architecture
  7. Chapter 7 System Administration
  8. Chapter 8 Testing and Continuous Integration
  9. Chapter 9 Message Queues and Celery
  10. Chapter 10 Service Orientation
  11. Chapter 11 Data Processing
  12. Chapter 12 Helper Tools
  13. Chapter 13 Concurrent Programming in Python
  14. Chapter 14 Advanced Python
  15. Chapter 15 Web Development Project Practice

FAQ

这本书适合零基础学Python的人读吗?
不太适合。书中默认读者已会Python语法并熟悉Linux基本命令,直接从框架选型、包管理与虚拟环境讲起。零基础读者建议先补Python语言基础,再来读本书。
书里主要讲Django还是Flask?
以Flask为主。第3、4章用大量篇幅讲Flask的路由、模板、上下文机制及各类扩展,并配有完整案例;Django只在框架选型部分简单提及比较。
2016年的书现在读会不会过时?
部分内容确实过时,如Python 2相关写法、早期Flask与Celery版本。但网站架构、部署监控、缓存策略、服务化与工程规范等思路仍有参考价值,建议作为技术地图使用,具体API对照新版文档。
没有实际项目经验能读懂吗?
可以,但建议边读边练。书中案例较多,若只是通读容易停留在概念层面;动手复现文件托管服务、Celery任务等例子,理解会深入得多。
书中的示例代码在哪里获取?
作者在GitHub上有公开账号,书中也提供了勘误与示例代码的获取渠道。建议先搜作者仓库再动手,注意代码基于旧版本,运行前需做兼容调整。

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.

More by the same author

Top rated in the same category