Flask Web开发:基于Python的Web应用开发实战

[美] Miguel Grinberg

出版时间

2014-12-01

ISBN

9787115373991

评分

★★★★★
书籍介绍

本书不仅适合初级Web开发人员学习阅读,更是Python程序员用来学习高级Web开发技术的优秀参考书。

• 学习Flask应用的基本结构,编写示例应用;

• 使用必备的组件,包括模板、数据库、Web表单和电子邮件支持;

• 使用包和模块构建可伸缩的大型应用;

• 实现用户认证、角色和个人资料;

• 在博客网站中重用模板、分页显示列表以及使用富文本;

• 使用基于Flask的REST式API,在智能手机、平板电脑和其他第三方客户端上实现可用功能;

• 学习运行单元测试以及提升性能;

• 将Web应用部署到生产服务器。

AI导读
核心看点
  • 系统讲解Flask框架基础与最佳实践
  • 通过博客项目实战串联知识点
  • 涵盖数据库、认证及部署全流程
适合谁读
  • Python初学者及Web开发新手
  • 希望系统学习Flask的程序员
  • 需要构建中小型Web应用的开发者
读前提醒
  • 建议结合GitHub源码对照阅读
  • 部分第三方库版本可能已过时
  • 需具备Python基础语法知识
读者共识
  • 内容详实,是Flask入门经典教材
  • 翻译质量参差不齐,阅读需耐心
  • 项目驱动式教学,实战指导性强

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "To start using the virtual environment, you have to “activate” it. If you are using a bash command line (Linux and Mac OS X users), you can activate the virtual environment with this command:"
  • "When a virtual environment is activated, the location of its Python interpreter is added to the PATH, but this change is not permanent; it affects only your current command session. To remind you that you have activated a virtual environment, the activation command modifies the command prompt to inc"
  • "When you are done working with the virtual environment and want to return to the global Python interpreter, type deactivate at the command prompt."
  • "The name argument that is passed to the Flask application construc‐ tor is a source of confusion among new Flask developers. Flask uses this argument to determine the root path of the application so that it later can find resource files relative to the location of the application."
  • "@app.route(404) def page_not_found(e): return render_template('404.html'),404 @app.route(500) def internal_server_error(e): return render_template('500.html'),500"
  • "PyCharm 2016.1 or 2016.2:Settings,Tools,Terminal, and add""/K <path-to-your-activate.bat>""toShell path and add (mind the quotes). Also add quotes around cmd.exe, resulting in: `"cmd.exe" /k ""C:\mypath\my-venv\Scripts\activate.bat""`"
  • "Web服务器网关接口(Python Web Server Gateway Interface,缩写为WSGI)是为Python语言定义的Web服务器和Web应用程序或框架之间的一种简单而通用的接口。自从WSGI被开发出来以后,许多其它语言中也出现了类似接口。WSGI是作为Web服务器与Web应用程序或应用框架之间的一种低级别的接口,以提升可移植Web应用开发的共同点。WSGI是基于现存的CGI标准而设计的。 WSGI区分为两个部份:一为“服务器”或“网关”,另一为“应用程序”或“应用框架”。在处理一个WSGI请求时,服务器会为应用程序提供环境资讯及一个回呼函数(Callback Functio"
  • "Why is that? The application will work even with __name__, thanks to how resources are looked up. However it will make debugging more painful. Certain extensions can make assumptions based on the import name of your application. For example the Flask-SQLAlchemy extension will look for the code in yo"
作者简介
Miguel Grinberg 拥有25年开发经验的高级软件工程师,目前为广播公司开发视频软件。他常在个人博客(blog.miguelgrinberg.com)上撰写各类博文,内容主要涉及Web开发、机器人技术、摄影,偶尔也会有一些影评。他和妻子、四个孩子、两只狗和一只猫共同生活在俄勒冈州波特兰市。Twitter:@miguelgrinberg。
目录
前言  XI
第一部分 Flask简介
第1章 安装  3
1.1 使用虚拟环境  4
1.2 使用pip安装Python包  6

显示全部
用户评论
读完了,贵在实践,写代码到第四章,继续努力
这大概是入门Flask最最经典的教材了。可是我依然看得很吃力,我的自控力啊啊~到哪里去了
python web development 中flask框架中文入门必备
书里的代码已经过时,要对照 GitHub 上的源码看
挺不错的,博客的例子基本就是一个个人网站的模型。
总体很详细的一本教材,里面介绍了很多之前被我习惯性忽略的有趣的插件。讲结构的第六章非常流畅,精巧详实。不足之处是有些过于简单的东西展开的篇幅太长,比如用户注册之类的...可能对新手来说更好上手吧。 @2017-12-13 19:26:03
A.对于web初学者尤其如此,好的老师和好的书更为关键。慢慢明白了,学编程要使用英文作为工作语言,其实还有一层意思是说听课一定也要听英文的课程。听了国内很多web培训,都不如听油管上最火的flask视频仔细一遍(B站有),讲的细致。B.建站是编程入门,不仅仅是学习使用框架使用的接口,更是网站知识的学习,最初听的云里雾里的原因,本质是网站的整个服务背后的知识不理解。c.当然学习一个框架使用最好的是官网,就像学习linux,最好的资料不是书,而是man一样,结合需求仔细读官网,应该是唯一深入学习的方法。D。框架源码的阅读,更多的是设计思想的,听听创作者的演讲很重要Armin Ronacher ,具体的实现可以通过git log 从低级版本到高级版本迭代进行阅读。
最早看过的flask,虽然只有两百页但是内容不少。只不过是2014年出版的,许多内容和代码都过时了
有的地方已经过时了,要自己一点点去翻坑填坑,学起来比较费力。翻译也不是特别好。
很一般,很多地方没有前置知识是看不懂的,不推荐入门学习就开始看这本,以官方文档为依据
下载
收藏