This is the seventh installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to do error handling in a Flask application. You are reading the 2024 edition of the Flask Mega-Tutorial. The complete course is also available to order in e-book and paperback formats...
本文翻译自The Flask Mega-Tutorial Part XI: Facelift 这是Flask Mega-Tutorial系列的第十一部分,我将告诉你如何用基于Bootstrap用户界面框架的新模板替换基础的HTML模板。 你把玩Microblog应用也有一段时间了,所以我相信你已经注意到,我没有花太多时间来美化它,说得更具体点,我根本没有花时间。 所有的模板只使用了...
本文翻译自 The Flask Mega-Tutorial Part IV: Database 在Flask Mega-Tutorial系列的第四部分,我将告诉你如何使用数据库。 本章的主题是重中之重!大多数应用都需要持久化存储数据,并高效地执行的增删查改的操作,数据库为此而生。 Flask中的数据库 Flask本身不支持数据库,相信你已经听说过了。 正如表单那样,这...
To avoid having to type the path to the Python interpreter you can add yourmicroblog/flask/Scriptsdirectory to the system path, making sure it appears before your regular Python interpreter. From now on, in this tutorial the Linux/OS X syntax will be used for brevity. If you are on Window...
It is pretty clear that theuser_idfield provides direct access to the author of a given post, but what about the reverse? For the relationship to be useful we should be able to get the list of posts written by a given user. Turns out theuser_idfield in thepoststable is enough to an...
Here the sentence that we want to translate has this structure: "<nickname>said<when>:". One would be tempted to just mark the word "said" for translation, but we can't really be sure that the order of the name and the time components in this sentence will be the same in all langu...
这是Flask Mega-Tutorial系列的第六部分,我将告诉你如何创建个人主页。 本章将致力于为应用添加个人主页。个人主页用来展示用户的相关信息,其个人信息由本人录入。 我将为你展示如何动态地生成每个用户的主页,并提供一个编辑页面给他们来更新个人信息。 本章的GitHub链接为:Browse,Zip,Diff. ...
本文翻译自The Flask Mega-Tutorial Part III: Web Forms 这是Flask Mega-Tutorial系列的第三部分,我将告诉你如何使用Web表单。 在第二章中我为应用主页创建了一个简单的模板,并使用诸如用户和用户动态的模拟对象。在本章中,我将解决这个应用程序中仍然存在的众多遗漏之一,那就是如何通过Web表单接受用户的输入。
跟着学习:flask mega-tutorial 1.1 documentation 回顾上一章:【Flask/跟着学习】Flask大型教程项目#00:Hello World! ## 本章内容 - 模板从天而降 - Jinja2引擎 - 回到我们的工程文件 ## 模板从天而降 如果你能够保持你的应用程序与网页的布局或者界面逻辑上是分开的,这样不是显得更加容易组织?难道你不觉得是这...
1、The Flask Mega-Tutorial 教程 这个教程是《Flask Web开发:基于Python的Web应用开发实战》作者 Miguel Grinberg 写的 2017版 Flask 教程,也是我强烈推荐给大家的 Flask 教程,英语阅读水平过得去的话,建议直接读原文,英语渣也有福音,国内已有网友把它翻译成了中文。 英文地址:blog.miguelgrinberg.com中文地址:github...