初识Flask AppBuilder

王 茂南 2018年2月4日06:41:24
评论
3 2118字阅读7分3秒
摘要这篇文章会简单介绍一下Flask AppBuilder是做什么的,以及放一张简单的运行之后的效果图。并且会有一点关于其作者对其与Flask Admin的介绍的文字。

缘起

新开了一个栏目,会介绍一下我学习Flask的一些事情吧。这个可能不会很系统,就是自己看到哪里就记录一下。

今天这一篇就来介绍一下Flask的一个插件,Flask AppBuilder,先不讲用法吧,就讲一下是做什么的和看一张效果图,等之后再补一下用法。

关于Flask AppBuilder

这是一个用来快速构建web后台的,就我今天尝试使用了一下,就是可以快速实现对表格增删改查。这是什么意思呢,我们可以看一下效果图:

 

初识Flask AppBuilder

就是你只需要把表格设计好,就可以直接管理这些表格了,就像上面图上的一样。(我也只是大概了解了一下,之后我再看了之后再详细讲一下)

我们可以看一下Flask AppBuilder关于这个的介绍,也是关于Flask AppBuilder和Flask Admin两个的比较:

Flask-Admin vs Flask-AppBuilder

下面是原文:

 


 

I am the developer of Flask-AppBuilder, so maybe a strong bias here. I will try to give you my most honest view. I do not know Flask-Admin that much, so i will probably make some mistakes.

Flask-Admin and Flask-AppBuilder:

  • Will both give you an admin interface for Flask with bootstrap.
  • Will both make their best to get out of your way.
  • Will both help you develop Flask more Object Oriented style.
  • Will both let you override almost everything on the admin templates.
  • Will both support Babel.
  • Both inspired on Django-Admin.

Pros for Flask-AppBuilder:

  • Has a nicer look and feel (bias? maybe...).
  • Security has been taken care of for you, and supports out of the box, database, LDAP, OpenID, Web server integrated (REMOTE_USER), and in the near future OAuth too. Will let you extend the user model and security views.
  • Granular permissions, creates one permission for each web exposed method and action (you have to try it).
  • You can easily render Google graphs.
  • Smaller project, it's easier to request new features, and get your pull requests merged.
  • MasterDetail views and multiple views can be setup easily.
  • Backends: supports SQLAlchemy, MongoEngine, GenericInterface (you can integrate with your own builtin data still a bit beta).

Pros for Flask-Admin:

  • You have to assemble your own security (models, views, auth etc), it's ready though to integrate nicely with flask-security. This can be a pro or a con depending on what you want.
  • Builtin File Admin.
  • Bigger project with bigger community.
  • Backends: supports SQLAlchemy, GeoAlchemy, MongoEngine, Pewee and PyMongo.
  • Better support for MongoEngine (EmbeddedDocument, ListFields etc..).

On the overall i think Flask-Admin makes no assumptions at all like Flask, you have to code more, but this will let you be more free. Flask-AppBuilder makes some assumptions (on security), you will have to code much less, but some things can get on your way if your building very specific security models.

Hope this helps you and others, i tried my best to keep the bias out.

 

 

其他

关于Flask的其他插件:awesome-flask

大家可以通过上面的链接来查看关于Flask的一些其他的插件。

  • 微信公众号
  • 关注微信公众号
  • weinxin
  • QQ群
  • 我们的QQ群号
  • weinxin
王 茂南
  • 本文由 发表于 2018年2月4日06:41:24
  • 转载请务必保留本文链接:https://mathpretty.com/8964.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: