Skip to content
Myr

foreword.rst

This file

Path

docs/foreword.rst

58 lines · 2.7 KiB

Last changed by

Merge pull request #3175 from singingwolfboy/fix-rst-line-too-longDavid Baumgoldbefore adoption819368a

History of this file

Take it

The walk stopped after 200 commits: lines older than c74f469 point at it.

Merge pull request #2436 from davidism/loggingDavid Lordbefore adoptionc74f469

lines 1–30why, one step back
1Foreword
2========34Read this before you get started with Flask. This hopefully answers some5questions about the purpose and goals of the project, and when you6should or should not be using it.78What does "micro" mean?9-----------------------1011“Micro” does not mean that your whole web application has to fit into a single12Python file (although it certainly can), nor does it mean that Flask is lacking13in functionality. The "micro" in microframework means Flask aims to keep the14core simple but extensible. Flask won't make many decisions for you, such as15what database to use. Those decisions that it does make, such as what16templating engine to use, are easy to change. Everything else is up to you, so17that Flask can be everything you need and nothing you don't.1819By default, Flask does not include a database abstraction layer, form20validation or anything else where different libraries already exist that can21handle that. Instead, Flask supports extensions to add such functionality to22your application as if it was implemented in Flask itself. Numerous extensions23provide database integration, form validation, upload handling, various open24authentication technologies, and more. Flask may be "micro", but it's ready for25production use on a variety of needs.2627Configuration and Conventions28-----------------------------2930Flask has many configuration values, with sensible defaults, and a few

Merge pull request #3175 from singingwolfboy/fix-rst-line-too-longDavid Baumgoldbefore adoption819368a

lines 31–35why, one step back
31conventions when getting started. By convention, templates and static
32files are stored in subdirectories within the application's Python33source tree, with the names :file:`templates` and :file:`static`34respectively. While this can be changed, you usually don't have to,35especially when getting started.

Merge pull request #2436 from davidism/loggingDavid Lordbefore adoptionc74f469

lines 36–58why, one step back
36
37Growing with Flask38------------------3940Once you have Flask up and running, you'll find a variety of extensions41available in the community to integrate your project for production. The Flask42core team reviews extensions and ensures approved extensions do not break with43future releases.4445As your codebase grows, you are free to make the design decisions appropriate46for your project. Flask will continue to provide a very simple glue layer to47the best that Python has to offer. You can implement advanced patterns in48SQLAlchemy or another database tool, introduce non-relational data persistence49as appropriate, and take advantage of framework-agnostic tools built for WSGI,50the Python web interface.5152Flask includes many hooks to customize its behavior. Should you need more53customization, the Flask class is built for subclassing. If you are interested54in that, check out the :ref:`becomingbig` chapter. If you are curious about55the Flask design principles, head over to the section about :ref:`design`.5657Continue to :ref:`installation`, the :ref:`quickstart`, or the58:ref:`advanced_foreword`.