介绍Flaskr

在本教程中,我们把我们的这个博客应用称为flaskr ,也可以选一个不那么 web 2.0 的名字;) ,基本上,我们希望它能做这些事情:

  1. Let the user sign in and out with credentials specified in the configuration. Only one user is supported.
  2. 当用户登入后,可以向页面添加条目,条目标题是纯文本,正文可以是一些HTML 。This HTML is not sanitized because we trust the user here.
  3. The index page shows all entries so far in reverse chronological order (newest on top) and the user can add new ones from there if logged in.

SQLite3 will be used directly for this application because it’s good enough for an application of this size. For larger applications, however, it makes a lot of sense to use SQLAlchemy, as it handles database connections in a more intelligent way, allowing you to target different relational databases at once and more. 如果你的数据更适合NoSQL,你也可以考虑流行的 NoSQL 数据库。

Here a screenshot of the final application:

screenshot of the final application

Continue with Step 0: Creating The Folders.