Basic Tutorial on Python Web Development (Django Edition) (Micro-course Edition)
Tags
Summary
Editor's review
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
- Follow the chapters in order and write the example code for each chapter by hand; do not just read without practicing.
- When studying models and views, reinforce your understanding with simple database operations (such as SQLite).
- 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 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章 Python Web开发起步
- 1.1 Python Web开发简介
- 1.1.1 Web应用基本架构
- 1.1.2 Web框架简介
- 1.1.3 Python Web框架简介
- 1.1.4 Django简介
- 1.2 配置Web开发环境
- 1.2.1 安装Python
- 1.2.2 安装Django
- 1.2.3 配置系统环境变量
- 1.2.4 安装Visual Studio
- 1.3 创建Django项目
- 1.3.1 执行命令创建项目
- 1.3.2 关于django-admin和manage.py
- 1.3.3 添加应用
- 1.3.4 在Visual Studio中创建项目
- 1.3.5 为项目定制虚拟开发环境
- 1.4 实践:创建HelloWorld项目
- 本章小结
- 习题
- 第2章 Django配置
- 2.1 Django项目配置文件
- 2.1.1 基本配置
- 2.1.2 模板配置
- 2.1.3 数据库配置
- 2.1.4 静态资源配置
- 2.2 在Web服务器中部署项目
- 2.2.1 常用Web服务器
- 2.2.2 WSGI简介
- 2.2.3 在IIS中部署Django项目
- 2.2.4 部署包含静态资源的Django项目
- 2.3 实践:在IIS中配置HelloWorld项目
- 本章小结
- 习题
- 第3章 URL分发
- 3.1 URL分发机制简介
- 3.2 URL配置
- 3.2.1 URL解析函数
- 3.2.2 使用正则表达式
- 3.2.3 包含其他的URL配置
- 3.3 URL参数传递
- 3.3.1 获取URL中的数据
- 3.3.2 路径转换器
- 3.3.3 正则表达式中的变量
- 3.3.4 传递附加数据
- 3.3.5 使用带默认值的参数
- 3.4 反向解析URL
- 3.4.1 反向解析不带参数的命名URL模式
- 3.4.2 反向解析带参数的命名URL模式
- 3.4.3 反向解析视图函数
- 3.4.4 在模板中反向解析URL
- 3.5 URL命名空间
- 3.5.1 URL命名空间简介
- 3.5.2 使用URL的应用命名空间
- 3.5.3 使用URL的实例命名空间
- 3.6 实践:为HelloWorld项目增加导航链接
- 本章小结
- 习题
- 第4章 模型和数据库
- 4.1 模型基础
- 4.1.1 定义模型
- 4.1.2 模型配置
- 4.1.3 迁移数据库
- 4.1.4 定义字段
- 4.2 数据操作
- 4.2.1 在Visual Studio中管理SQLite数据库
- 4.2.2 添加数据
- 4.2.3 获取数据
- 4.2.4 字段查找
- 4.2.5 更新数据
- 4.2.6 删除数据
- 4.2.7 查询集操作
- 4.3 索引
- 4.3.1 使用字段选项创建索引
- 4.3.2 在Meta子类中定义索引
- 4.4 特殊查询表达式
- 4.4.1 准备实例数据
- 4.4.2 F()表达式
- 4.4.3 数据库函数表达式
- 4.4.4 Subquery()表达式
- 4.4.5 聚合函数
- 4.4.6 原始SQL表达式
- 4.5 执行原始SQL查询
- 4.5.1 用raw()方法执行原始SQL
- 4.5.2 直接执行原始SQL
- 4.6 关系
- 4.6.1 多对一关系
- 4.6.2 多对多关系
- 4.6.3 使用中间模型
- 4.6.4 一对一关系
- 4.7 实践:定义用户模型
- 本章小结
- 习题
- 第5章 视图
- 5.1 定义视图
- 5.1.1 定义和使用视图
- 5.1.2 返回错误
- 5.1.3 处理Http404异常
- 5.2 处理请求和响应
- 5.2.1 获取请求数据
- 5.2.2 处理响应内容
- 5.2.3 文件附件
- 5.2.4 生成CSV文件
- 5.2.5 生成PDF文件
- 5.2.6 返回JSON字符串
- 5.2.7 使用响应模板
- 5.2.8 重定向
- 5.3 在视图中使用模型
- 5.3.1 在视图中输出模型数据
- 5.3.2 数据分页
- 5.4 基于类的视图
- 5.4.1 使用基于类的视图
- 5.4.2 设置视图类属性
- 5.4.3 扩展视图类
- 5.5 内置通用视图
- 5.5.1 通用视图DetailView
- 5.5.2 通用视图ListView
- 5.6 实践:实现图形验证码
- 本章小结
- 习题
- 第6章 模板
- 6.1 模板基础
- 6.1.1 配置模板引擎
- 6.1.2 使用模板类
- 6.1.3 使用模板文件
- 6.2 模板语言
- 6.2.1 变量
- 6.2.2 注释
- 6.2.3 过滤器
- 6.2.4 标签:include
- 6.2.5 标签:for
- 6.2.6 标签:if
- 6.3 模板继承
- 6.4 实践:用模板实现数据分页
- 本章小结
- 习题
- 第7章 表单
- 7.1 表单基础
- 7.1.1 HTML表单
- 7.1.2 Django表单
- 7.2 Django表单进阶
- 7.2.1 表单字段渲染方式
- 7.2.2 表单字段类型和参数
- 7.2.3 使用小部件
- 7.2.4 字段校验
- 7.2.5 使用表单数据
- 7.2.6 手动渲染字段
- 7.2.7 遍历字段
- 7.2.8 表单集
- 7.3 模型表单
- 7.3.1 模型表单基本操作
- 7.3.2 在视图中使用模型表单
- 7.3.3 自定义模型表单字段
- 7.4 资源
- 7.4.1 小部件资源
- 7.4.2 表单资源
- 7.5 Ajax
- 7.5.1 实现客户端Web页面
- 7.5.2 处理请求
- 7.6 实践:实现用户注册
- 本章小结
- 习题
- 第8章 Django工具
- 8.1 Admin站点
- 8.1.1 启用Admin站点
- 8.1.2 管理用户
- 8.1.3 管理组
- 8.1.4 管理模型
- 8.2 用户认证
- 8.2.1 用户认证相关模型
- 8.2.2 控制台用户管理
- 8.2.3 内置认证视图
- 8.2.4 自定义视图中的身份认证
- 8.2.5 限制页面登录访问
- 8.2.6 限制页面访问权限
- 8.2.7 自定义页面访问限制条件
- 8.3 发送E-mail
- 8.3.1 E-mail配置
- 8.3.2 发送密码重置邮件
- 8.3.3 自定义E-mail发送
- 8.3.4 E-mail后端
- 8.4 会话控制
- 8.4.1 启用会话控制
- 8.4.2 会话对象方法
- 8.4.3 在视图中使用会话
- 8.5 实践:自定义User模型
- 本章小结
- 习题
- 第9章 Python在线题库
- 9.1 项目设计
- 9.1.1 功能分析
- 9.1.2 数据库设计
- 9.2 项目实现
- 9.2.1 创建项目和应用
- 9.2.2 创建模型和数据库
- 9.2.3 注册模型
- 9.2.4 创建添加和修改试题对象模板
- 9.2.5 创建添加和修改试卷内容对象模板
- 9.2.6 实现随机抽取试题
- 9.3 数据管理
- 9.3.1 试题类型模型管理
- 9.3.2 试题模型管理
- 9.3.3 试卷模板模型管理
- 9.3.4 试卷内容模型管理
- 9.4 实现试卷导出
- 9.4.1 基本思路
- 9.4.2 定义试卷导出页面模板
- 9.4.3 定义试卷导出相关视图
- 9.4.4 测试试卷导出页面
- 本章小结
- 习题
FAQ
How much Python background does this book assume?
What exactly does "Micro-Lecture Edition" mean? How does it help learning?
What level can I reach after finishing this book?
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
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.