What are Flask Blueprints, exactly?

后端 未结 5 2014
感动是毒
感动是毒 2020-12-12 08:22

I have read the official Flask documentation on Blueprints and even one or two blog posts on using them.

I\'ve even used them in my web app, but I don\'t co

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-12 09:05

    As pointed out in a comment by @Devasish, this article provides a good answer:

    http://exploreflask.com/en/latest/blueprints.html

    Quoting from the article:

    An example of this would be Facebook. If Facebook used Flask, it might have blueprints for the static pages (i.e. signed-out home, register, about, etc.), the dashboard (i.e. the news feed), profiles (/robert/about and /robert/photos), settings (/settings/security and /settings/privacy) and many more. These components all share a general layout and styles, but each has its own layout as well

    This is a very good interpretation, especially the part "if Facebook used Flask". It gives us a concrete situation to visualize how Blueprint actually works.

提交回复
热议问题