Glossary

Flask

Flask is a lightweight "micro" web framework for Python, created by Armin Ronacher. Unlike Django's batteries-included approach, Flask provides the essentials — URL routing, request/response handling, templates (via Jinja2), and a development server — and lets you choose your own database layer, authentication system, form library, and other components. This makes Flask ideal for small applications, APIs, microservices, and projects where you want full control over your stack.

Flask applications are often remarkably concise: a "Hello, World" web app is about five lines of code. Routes are defined with decorators (@app.route('/path')), and view functions return strings, HTML, JSON, or Response objects. Flask's extension ecosystem provides optional components: Flask-SQLAlchemy (ORM), Flask-Login (authentication), Flask-WTF (forms), Flask-RESTful (APIs), and many more.

Flask's philosophy of simplicity and explicitness makes it an excellent learning tool for understanding how web frameworks work. It is also widely used in production for APIs and microservices. For large, complex applications that need an ORM, admin panel, and authentication out of the box, Django may be more appropriate; for high-performance async APIs, FastAPI has become the modern favourite. Flask occupies the middle ground — simple enough to start quickly, flexible enough to scale.

Related terms: Django, FastAPI

Discussed in:

This site is currently in Beta. Please email Chris Paton (cpaton@gmail.com) with any suggestions, questions or comments.