Made the foreword less defensive.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent 2e4c391 · Browse files · 1 file·+23 added−27 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+23 added−27 removed
- other:+23 added−27 removed
Provenance
- Commit
dc05722- Tree
77e850c- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
2e4c391
1 file changed+23 added−27 removed
modified:docs/foreword.rst+23 added-27 removed
7 unmodified lines8 What does "micro" mean?9 -----------------------10 11 To me, the "micro" in microframework refers not only to the simplicity and12-small size of the framework, but also to the typically limited complexity13-and size of applications that are written with the framework. Also the14-fact that you can have an entire application in a single Python file. To15-be approachable and concise, a microframework sacrifices a few features16-that may be necessary in larger or more complex applications.12+small size of the framework, but also the fact that it does not make much13+decisions for you. While Flask does pick a templating engine for you, we14+won't make such decisions for your datastore or other parts.15 18-For example, Flask uses thread-local objects internally so that you don't19-have to pass objects around from function to function within a request in20-order to stay threadsafe. While this is a really easy approach and saves21-you a lot of time, it might also cause some troubles for very large22-applications because changes on these thread-local objects can happen23-anywhere in the same thread.16+For us however the term “micro” does not mean that the whole implementation17+has to fit into a single Python file.18 25-Flask provides some tools to deal with the downsides of this approach but26-it might be an issue for larger applications because in theory27-modifications on these objects might happen anywhere in the same thread.19+One of the design decisions with Flask was that simple tasks should be20+simple and not take up a lot of code and yet not limit yourself. Because21+of that we took a few design choices that some people might find22+surprising or unorthodox. For example, Flask uses thread-local objects23+internally so that you don't have to pass objects around from function to24+function within a request in order to stay threadsafe. While this is a25+really easy approach and saves you a lot of time, it might also cause some26+troubles for very large applications because changes on these thread-local27+objects can happen anywhere in the same thread. In order to solve these28+problems we don't hide the thread locals for you but instead embrace them29+and provide you with a lot of tools to make it as pleasant as possible to30+work with them.31 32 Flask is also based on convention over configuration, which means that33 many things are preconfigured. For example, by convention, templates and34 static files are in subdirectories within the Python source tree of the32-application.35+application. While this can be changed you usually don't have to.36 37 The main reason however why Flask is called a "microframework" is the idea38 to keep the core simple but extensible. There is no database abstraction39 layer, no form validation or anything else where different libraries2 unmodified lines42 was implemented in Flask itself. There are currently extensions for43 object relational mappers, form validation, upload handling, various open44 authentication technologies and more.45 43-However Flask is not much code and it is built on a very solid foundation44-and with that it is very easy to adapt for large applications. If you are45-interested in that, check out the :ref:`becomingbig` chapter.46+Since Flask is based on a very solid foundation there is not a lot of code47+in Flask itself. As such it's easy to adapt even for lage applications48+and we are making sure that you can either configure it as much as49+possible by subclassing things or by forking the entire codebase. If you50+are interested in that, check out the :ref:`becomingbig` chapter.51 52 If you are curious about the Flask design principles, head over to the53 section about :ref:`design`.54 50-A Framework and an Example51---------------------------52-53-Flask is not only a microframework; it is also an example. Based on54-Flask, there will be a series of blog posts that explain how to create a55-framework. Flask itself is just one way to implement a framework on top56-of existing libraries. Unlike many other microframeworks, Flask does not57-try to implement everything on its own; it reuses existing code.58-55 Web Development is Dangerous56 ----------------------------57 58 I'm not joking. Well, maybe a little. If you write a web42 unmodified lines