Rewrote parts of the foreword and becoming big section
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 2912ff6 · Browse files · 2 files·+40 added−34 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+40 added−34 removed
- other:+40 added−34 removed
Provenance
- Commit
cd48332- Tree
76e9d27- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
2912ff6
2 files changed+40 added−34 removed
modified:docs/becomingbig.rst+24 added-12 removed
16 unmodified lines17 18 Flask is designed to be extended and modified in a couple of different19 ways:20 21+- Flask extensions. For a lot of reusable functionality you can create22+ extensions. For extensions a number of hooks exist throughout Flask23+ with signals and callback functions.24+25 - Subclassing. The majority of functionality can be changed by creating26 a new subclass of the :class:`~flask.Flask` class and overriding23- some methods.27+ methods provided for this exact purpose.28 25-- Flask extensions. For a lot of reusable functionality you can create26- extensions.27-29 - Forking. If nothing else works out you can just take the Flask30 codebase at a given point and copy/paste it into your application31 and change it. Flask is designed with that in mind and makes this32 incredible easy. You just have to take the package and copy it16 unmodified lines49 reflected in the license of Flask. You don't have to contribute any50 changes back if you decide to modify the framework.51 52 The downside of forking is of course that Flask extensions will most52-likely break because the new framework has a different import name and53-because of that forking should be the last resort.53+likely break because the new framework has a different import name.54+Furthermore integrating upstream changes can be a complex process,55+depending on the number of changes. Because of that, forking should be56+the very last resort.57 58 Scaling like a Pro59 ------------------60 9 unmodified lines70 support a second server.71 72 There is only one limiting factor regarding scaling in Flask which are73 the context local proxies. They depend on context which in Flask is71-defined as being either a thread or a greenlet. Separate processes are72-fine as well. If your server uses some kind of concurrency that is not73-based on threads or greenlets, Flask will no longer be able to support74-these global proxies. However the majority of servers are using either75-threads, greenlets or separate processes to achieve concurrency which are76-all methods well supported by the underlying Werkzeug library.74+defined as being either a thread, process or greenlet. If your server75+uses some kind of concurrency that is not based on threads or greenlets,76+Flask will no longer be able to support these global proxies. However the77+majority of servers are using either threads, greenlets or separate78+processes to achieve concurrency which are all methods well supported by79+the underlying Werkzeug library.80+81+Dialogue with the Community82+---------------------------83+84+The Flask developers are very interested to keep everybody happy, so as85+soon as you find an obstacle in your way, caused by Flask, don't hesitate86+to contact the developers on the mailinglist or IRC channel. The best way87+for the Flask and Flask-extension developers to improve it for larger88+applications is getting feedback from users.modified:docs/foreword.rst+16 added-22 removed
21 unmodified lines22 applications because changes on these thread-local objects can happen23 anywhere in the same thread.24 25 Flask provides some tools to deal with the downsides of this approach but26-it might be an issue for larger applications. Flask is also based on27-convention over configuration, which means that many things are28-preconfigured and will work well for smaller applications but not so well29-for larger ones. For example, by convention, templates and static files30-are in subdirectories within the Python source tree of the application.26+it might be an issue for larger applications because in theory27+modifications on these objects might happen anywhere in the same thread.28 29+Flask is also based on convention over configuration, which means that30+many things are preconfigured. For example, by convention, templates and31+static files are in subdirectories within the Python source tree of the32+application.33+34+The main reason however why Flask is called a "microframework" is the idea35+to keep the core simple but extensible. There is database abstraction36+layer, no form validation or anything else where different libraries37+already exist that can handle that. However Flask knows the concept of38+extensions that can add this functionality into your application as if it39+was implemented in Flask itself. There are currently extensions for40+object relational mappers, form validation, upload handling, various open41+authentication technologies and more.42+43 However Flask is not much code and built in a very solid foundation and44 with that very easy to adapt for large applications. If you are45 interested in that, check out the :ref:`becomingbig` chapter.46 32 unmodified lines79 probing for ways to fill your database with spam, links to malicious80 software, and the like.81 82 So always keep security in mind when doing web development.72-73-Target Audience74----------------75-76-Is Flask for you? If your application is small or medium sized and does77-not depend on very complex database structures, Flask is the Framework for78-you. It was designed from the ground up to be easy to use, and built on79-the firm foundation of established principles, good intentions, and80-mature, widely used libraries. Recent versions of Flask scale nicely81-within reasonable bounds, and if you grow larger, you won't have any82-trouble adjusting Flask for your new application size.83-84-If you suddenly discover that your application grows larger than85-originally intended, head over to the :ref:`becomingbig` section to see86-some possible solutions for larger applications.87-88-Satisfied? Then let's proceed with :ref:`installation`.