Foreword

Read this before you get started with Flask. This hopefully answers somequestions about the purpose and goals of the project, and when youshould or should not be using it.

What does “micro” mean?

“Micro” does not mean that your whole web application has to fit into a singlePython file (although it certainly can), nor does it mean that Flask is lackingin functionality. The “micro” in microframework means Flask aims to keep thecore simple but extensible. Flask won’t make many decisions for you, such aswhat database to use. Those decisions that it does make, such as whattemplating engine to use, are easy to change. Everything else is up to you, sothat Flask can be everything you need and nothing you don’t.

By default, Flask does not include a database abstraction layer, formvalidation or anything else where different libraries already exist that canhandle that. Instead, Flask supports extensions to add such functionality toyour application as if it was implemented in Flask itself. Numerous extensionsprovide database integration, form validation, upload handling, various openauthentication technologies, and more. Flask may be “micro”, but it’s ready forproduction use on a variety of needs.

Configuration and Conventions

Flask has many configuration values, with sensible defaults, and a fewconventions when getting started. By convention, templates and staticfiles are stored in subdirectories within the application’s Pythonsource tree, with the names templates and staticrespectively. While this can be changed, you usually don’t have to,especially when getting started.

Growing with Flask

Once you have Flask up and running, you’ll find a variety of extensionsavailable in the community to integrate your project for production. The Flaskcore team reviews extensions and ensures approved extensions do not break withfuture releases.

As your codebase grows, you are free to make the design decisions appropriatefor your project. Flask will continue to provide a very simple glue layer tothe best that Python has to offer. You can implement advanced patterns inSQLAlchemy or another database tool, introduce non-relational data persistenceas appropriate, and take advantage of framework-agnostic tools built for WSGI,the Python web interface.

Flask includes many hooks to customize its behavior. Should you need morecustomization, the Flask class is built for subclassing. If you are interestedin that, check out the Becoming Big chapter. If you are curious aboutthe Flask design principles, head over to the section about Design Decisions in Flask.

Continue to Installation, the Quickstart, or theForeword for Experienced Programmers.