Basic Tutorial on Python Web Development (Django Edition) (Micro-course Edition) cover

Basic Tutorial on Python Web Development (Django Edition) (Micro-course Edition)

Rating 3.4
Word count
86K words
Chapters
214
ISBN
9787115522795

Tags

Summary

This book provides a systematic introduction to the fundamentals of Python Web development with the Django framework, covering development environment setup, Django configuration, URL dispatching, models and databases, views, templates, forms, and Django tools. Each concept is illustrated with practical examples to aid understanding, and every chapter ends with a comprehensive example demonstrating how the chapter's knowledge is applied.

Editor's review

Python Web Development Fundamentals (Django Edition) (Micro-Lecture Edition), published by Posts & Telecom Press, is a beginner-oriented guide to Python Web development. Centered on the Django framework, the book starts from basic Python syntax and progresses to core topics such as the Django MTV design pattern, routing, views, templates, models, forms, user authentication, and deployment. Its distinguishing feature is the "micro-lecture" approach, which breaks complex topics into short, focused learning units supported by abundant example code and step-by-step instructions, lowering the learning curve. The author, Xia Banggui, has years of hands-on development and teaching experience, and his style emphasizes the integration of practice and theory, making the book well suited to classroom teaching or self-study. In today's Python Web landscape, Django remains a mainstream choice for medium-to-large projects thanks to its "batteries-included, ready-out-of-the-box" nature. The book's value lies in offering a clearly structured, fast-start path that helps readers avoid common early configuration and conceptual pitfalls, quickly build a runnable project prototype, and develop a systematic understanding of the Web development workflow. For readers seeking a practical back-end skill, it is a reliable hands-on manual for going from zero to one.

Who it's for

A good fit for

  • Learners with a little Python syntax who want to move into Web development
  • University students in computer-related majors currently taking Web development courses
  • Engineers who need to quickly master Django to build internal tools or project prototypes
  • Self-learners interested in the Web back-end development workflow who want a systematic introductory tutorial

Not a good fit for

  • Advanced developers seeking in-depth coverage of advanced Django features, source code analysis, or performance optimization
  • Readers who want to learn other Python Web frameworks such as Flask or FastAPI

Reading tips

  1. Follow the chapters in order and write the example code for each chapter by hand; do not just read without practicing.
  2. When studying models and views, reinforce your understanding with simple database operations (such as SQLite).
  3. After finishing the basics, try building a small personal project with CRUD functionality on your own using what you have learned, to consolidate your knowledge.

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. 版权信息
  2. 内容提要
  3. 前言
  4. 第1章 Python Web开发起步
  5. 1.1 Python Web开发简介
  6. 1.1.1 Web应用基本架构
  7. 1.1.2 Web框架简介
  8. 1.1.3 Python Web框架简介
  9. 1.1.4 Django简介
  10. 1.2 配置Web开发环境
  11. 1.2.1 安装Python
  12. 1.2.2 安装Django
  13. 1.2.3 配置系统环境变量
  14. 1.2.4 安装Visual Studio
  15. 1.3 创建Django项目
  16. 1.3.1 执行命令创建项目
  17. 1.3.2 关于django-admin和manage.py
  18. 1.3.3 添加应用
  19. 1.3.4 在Visual Studio中创建项目
  20. 1.3.5 为项目定制虚拟开发环境
  21. 1.4 实践:创建HelloWorld项目
  22. 本章小结
  23. 习题
  24. 第2章 Django配置
  25. 2.1 Django项目配置文件
  26. 2.1.1 基本配置
  27. 2.1.2 模板配置
  28. 2.1.3 数据库配置
  29. 2.1.4 静态资源配置
  30. 2.2 在Web服务器中部署项目
  31. 2.2.1 常用Web服务器
  32. 2.2.2 WSGI简介
  33. 2.2.3 在IIS中部署Django项目
  34. 2.2.4 部署包含静态资源的Django项目
  35. 2.3 实践:在IIS中配置HelloWorld项目
  36. 本章小结
  37. 习题
  38. 第3章 URL分发
  39. 3.1 URL分发机制简介
  40. 3.2 URL配置
  41. 3.2.1 URL解析函数
  42. 3.2.2 使用正则表达式
  43. 3.2.3 包含其他的URL配置
  44. 3.3 URL参数传递
  45. 3.3.1 获取URL中的数据
  46. 3.3.2 路径转换器
  47. 3.3.3 正则表达式中的变量
  48. 3.3.4 传递附加数据
  49. 3.3.5 使用带默认值的参数
  50. 3.4 反向解析URL
  51. 3.4.1 反向解析不带参数的命名URL模式
  52. 3.4.2 反向解析带参数的命名URL模式
  53. 3.4.3 反向解析视图函数
  54. 3.4.4 在模板中反向解析URL
  55. 3.5 URL命名空间
  56. 3.5.1 URL命名空间简介
  57. 3.5.2 使用URL的应用命名空间
  58. 3.5.3 使用URL的实例命名空间
  59. 3.6 实践:为HelloWorld项目增加导航链接
  60. 本章小结
  61. 习题
  62. 第4章 模型和数据库
  63. 4.1 模型基础
  64. 4.1.1 定义模型
  65. 4.1.2 模型配置
  66. 4.1.3 迁移数据库
  67. 4.1.4 定义字段
  68. 4.2 数据操作
  69. 4.2.1 在Visual Studio中管理SQLite数据库
  70. 4.2.2 添加数据
  71. 4.2.3 获取数据
  72. 4.2.4 字段查找
  73. 4.2.5 更新数据
  74. 4.2.6 删除数据
  75. 4.2.7 查询集操作
  76. 4.3 索引
  77. 4.3.1 使用字段选项创建索引
  78. 4.3.2 在Meta子类中定义索引
  79. 4.4 特殊查询表达式
  80. 4.4.1 准备实例数据
  81. 4.4.2 F()表达式
  82. 4.4.3 数据库函数表达式
  83. 4.4.4 Subquery()表达式
  84. 4.4.5 聚合函数
  85. 4.4.6 原始SQL表达式
  86. 4.5 执行原始SQL查询
  87. 4.5.1 用raw()方法执行原始SQL
  88. 4.5.2 直接执行原始SQL
  89. 4.6 关系
  90. 4.6.1 多对一关系
  91. 4.6.2 多对多关系
  92. 4.6.3 使用中间模型
  93. 4.6.4 一对一关系
  94. 4.7 实践:定义用户模型
  95. 本章小结
  96. 习题
  97. 第5章 视图
  98. 5.1 定义视图
  99. 5.1.1 定义和使用视图
  100. 5.1.2 返回错误
  101. 5.1.3 处理Http404异常
  102. 5.2 处理请求和响应
  103. 5.2.1 获取请求数据
  104. 5.2.2 处理响应内容
  105. 5.2.3 文件附件
  106. 5.2.4 生成CSV文件
  107. 5.2.5 生成PDF文件
  108. 5.2.6 返回JSON字符串
  109. 5.2.7 使用响应模板
  110. 5.2.8 重定向
  111. 5.3 在视图中使用模型
  112. 5.3.1 在视图中输出模型数据
  113. 5.3.2 数据分页
  114. 5.4 基于类的视图
  115. 5.4.1 使用基于类的视图
  116. 5.4.2 设置视图类属性
  117. 5.4.3 扩展视图类
  118. 5.5 内置通用视图
  119. 5.5.1 通用视图DetailView
  120. 5.5.2 通用视图ListView
  121. 5.6 实践:实现图形验证码
  122. 本章小结
  123. 习题
  124. 第6章 模板
  125. 6.1 模板基础
  126. 6.1.1 配置模板引擎
  127. 6.1.2 使用模板类
  128. 6.1.3 使用模板文件
  129. 6.2 模板语言
  130. 6.2.1 变量
  131. 6.2.2 注释
  132. 6.2.3 过滤器
  133. 6.2.4 标签:include
  134. 6.2.5 标签:for
  135. 6.2.6 标签:if
  136. 6.3 模板继承
  137. 6.4 实践:用模板实现数据分页
  138. 本章小结
  139. 习题
  140. 第7章 表单
  141. 7.1 表单基础
  142. 7.1.1 HTML表单
  143. 7.1.2 Django表单
  144. 7.2 Django表单进阶
  145. 7.2.1 表单字段渲染方式
  146. 7.2.2 表单字段类型和参数
  147. 7.2.3 使用小部件
  148. 7.2.4 字段校验
  149. 7.2.5 使用表单数据
  150. 7.2.6 手动渲染字段
  151. 7.2.7 遍历字段
  152. 7.2.8 表单集
  153. 7.3 模型表单
  154. 7.3.1 模型表单基本操作
  155. 7.3.2 在视图中使用模型表单
  156. 7.3.3 自定义模型表单字段
  157. 7.4 资源
  158. 7.4.1 小部件资源
  159. 7.4.2 表单资源
  160. 7.5 Ajax
  161. 7.5.1 实现客户端Web页面
  162. 7.5.2 处理请求
  163. 7.6 实践:实现用户注册
  164. 本章小结
  165. 习题
  166. 第8章 Django工具
  167. 8.1 Admin站点
  168. 8.1.1 启用Admin站点
  169. 8.1.2 管理用户
  170. 8.1.3 管理组
  171. 8.1.4 管理模型
  172. 8.2 用户认证
  173. 8.2.1 用户认证相关模型
  174. 8.2.2 控制台用户管理
  175. 8.2.3 内置认证视图
  176. 8.2.4 自定义视图中的身份认证
  177. 8.2.5 限制页面登录访问
  178. 8.2.6 限制页面访问权限
  179. 8.2.7 自定义页面访问限制条件
  180. 8.3 发送E-mail
  181. 8.3.1 E-mail配置
  182. 8.3.2 发送密码重置邮件
  183. 8.3.3 自定义E-mail发送
  184. 8.3.4 E-mail后端
  185. 8.4 会话控制
  186. 8.4.1 启用会话控制
  187. 8.4.2 会话对象方法
  188. 8.4.3 在视图中使用会话
  189. 8.5 实践:自定义User模型
  190. 本章小结
  191. 习题
  192. 第9章 Python在线题库
  193. 9.1 项目设计
  194. 9.1.1 功能分析
  195. 9.1.2 数据库设计
  196. 9.2 项目实现
  197. 9.2.1 创建项目和应用
  198. 9.2.2 创建模型和数据库
  199. 9.2.3 注册模型
  200. 9.2.4 创建添加和修改试题对象模板
  201. 9.2.5 创建添加和修改试卷内容对象模板
  202. 9.2.6 实现随机抽取试题
  203. 9.3 数据管理
  204. 9.3.1 试题类型模型管理
  205. 9.3.2 试题模型管理
  206. 9.3.3 试卷模板模型管理
  207. 9.3.4 试卷内容模型管理
  208. 9.4 实现试卷导出
  209. 9.4.1 基本思路
  210. 9.4.2 定义试卷导出页面模板
  211. 9.4.3 定义试卷导出相关视图
  212. 9.4.4 测试试卷导出页面
  213. 本章小结
  214. 习题

FAQ

How much Python background does this book assume?
The book starts from Python basics but moves quickly. Readers are advised to understand basic Python syntax, data types, and functions so they can transition smoothly into Web development.
What exactly does "Micro-Lecture Edition" mean? How does it help learning?
"Micro-lecture" generally means breaking the knowledge system into many short, focused video or text units. In this book it manifests as finely divided knowledge points, detailed step-by-step explanations, and possibly related learning resources, helping readers learn gradually in fragmented time and reducing the information load of each session.
What level can I reach after finishing this book?
After finishing the book, readers should understand Django's core concepts and development workflow, be able to independently build Web applications with basic admin management, user interaction, and data persistence using Django, and have a solid foundation for learning more complex project architecture and deployment operations.

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

Xia Banggui is an active author of technical books in the Chinese book market. Public information about him is limited, and no clear record of his background or professional positions is available. Judging from the four works held in the collection, his writing focuses on introductory teaching in computer programming and data analysis, covering topics such as data analysis and visualization with Power BI, front-end development with JavaScript and jQuery, Python Web development based on Django, and Android mobile application development. Most of these works are presented as "micro-course editions" with accompanying teaching resources, and they are commonly classified under exam preparation and programming design, indicating that their target readers are mainly university students, beginners, and readers who need to learn development skills systematically. Overall, Xia Banggui's books emphasize step-by-step explanation of fundamentals and hands-on practice, offering practical reference value in introductory programming and data analysis instruction.

More by the same author

Top rated in the same category