pallets/flask
68.9
Adequate · 14 November 2026
8.1k
lines of production code
Python
primary language
7
measurements over time
What this system is
Features
Add Celery background task example
Added a new example in the examples/celery directory demonstrating how to integrate Celery with Flask for background task execution. The example includes a Flask application that configures a Celery worker with Redis, defines sample tasks (add, block, process), and provides a web interface with JavaScript polling to submit tasks and monitor their progress and results.
examples/celery · high confidence
Add JavaScript AJAX example application
A new Flask-based example application has been added to demonstrate JavaScript AJAX interactions. The app serves templates for XHR, jQuery, and Fetch API implementations and includes a simple endpoint that accepts two numbers via POST and returns their sum as JSON.
_examples/javascript/js\example · high confidence
Add JavaScript AJAX examples using Fetch, XHR, and jQuery
The examples directory now includes a set of template files (base.html, fetch.html, xhr.html, jquery.html) that demonstrate how to perform AJAX requests in JavaScript using three different approaches: the modern Fetch API, the legacy XMLHttpRequest, and the jQuery library. These templates provide a shared UI for calculating sums and include specific script blocks showing the implementation details for each method, allowing users to compare the syntax and usage of these different JavaScript HTTP client techniques.
_examples/javascript/js\example/templates · high confidence
Add VS Code Dev Container configuration for Flask development
Developers can now use VS Code Dev Containers to set up a consistent Python 3 development environment for the Flask project. The new configuration automatically creates a virtual environment, installs development dependencies from requirements/dev.txt, installs the package in editable mode, and sets up pre-commit hooks upon container creation.
.devcontainer · high confidence
Removals
Removal of MiniTwit example templates
The Jinja2 template files for the MiniTwit example application (layout, login, register, and timeline) have been deleted. This removes the HTML structure and view logic for the example, effectively taking the MiniTwit demo application offline.
examples/minitwit/templates · high confidence
Removed the apishowcase example application
The apishowcase example, which demonstrated a Flask-based application with routes for greeting users and a counter, has been removed from the examples directory. This deletion includes the main Python script, associated HTML templates, and static CSS files, meaning users can no longer run or reference this specific demonstration.
examples/apishowcase, examples/minitwit · high confidence
Architecture
Flask 3.0 source code restructured into src/flask
The Flask application package has been reorganized into the standard src layout, with all core modules (app, blueprints, CLI, config, context, globals, helpers, logging, sessions, etc.) now located under src/flask. This change improves package isolation and aligns with modern Python packaging practices, but does not alter the public API or runtime behavior for existing applications.
src/flask · high confidence
Flask core logic refactored into a framework-agnostic Sans-IO layer
The application and blueprint logic has been extracted into the new \src/flask/sansio\ package, creating a framework-agnostic core that performs no I/O and avoids Flask-specific globals. This change enables alternative WSGI servers, such as Quart, to reuse Flask's routing, templating, and configuration logic without being tied to Flask's specific I/O implementation.
src/flask/sansio · high confidence
Behavioural changes
New JSON provider interface for customizable serialization
Flask now uses a pluggable JSON provider system (via \app.json\) to handle serialization and deserialization, allowing applications to override default behaviors or swap in different JSON libraries. The default provider serializes \datetime\ objects to HTTP-date strings, \Decimal\ and \UUID\ to strings, and dataclasses to dictionaries. This change also removes the deprecated \encoding\ parameter from JSON functions and drops support for Python 3.6 and earlier versions.
src/flask/json · high confidence
Rewritten Flaskr tutorial with application factory and blueprints
The Flaskr tutorial example has been completely rewritten to demonstrate modern Flask best practices. The application now uses an application factory pattern (\create\_app\) instead of a global app instance, and organizes functionality into blueprints for authentication (\auth\) and blog posts (\blog\). The database layer (\db.py\) has been updated to use SQLite with proper connection handling via \g\ and teardown hooks, including a custom converter for timestamp columns. The UI templates have been refreshed with a new CSS stylesheet and include support for user registration, login, logout, and full CRUD operations for blog posts, with authorship checks enforced on updates and deletions.
examples/tutorial/flaskr · high confidence
Test coverage
Added Jinja2 template fixtures for testing; Added subdomain test module fixture; Added test fixtures for admin and frontend blueprints; Added test fixtures for static file serving; Added test infrastructure for blueprintapp; Added test suite for the Flask tutorial application; Added tests for the JavaScript example application; Initial test suite and test infrastructure.
Dependencies
Initial project scaffolding with pre-commit and uv tooling
The repository now includes configuration for development tooling: an \.editorconfig\ standardizes indentation (4 spaces for Python, 2 for other files) and line endings, a \.pre-commit-config.yaml\ sets up hooks for \ruff\ (linting/formatting), \uv\ (lockfile management), \codespell\, and standard git hooks, and a \.readthedocs.yaml\ configures the documentation build environment to use \uv\ and Python 3.13. A \uv.lock\ file is also added to manage dependencies, and the legacy \flask.py\ single-file module has been removed.
(repo-wide) · high confidence
Migrate to pyproject.toml and update dependencies
The project and its examples now use pyproject.toml for configuration, replacing older setup files. The main Flask package now requires Python 3.10+ and updates its core dependencies, including Werkzeug to \>=3.1.0 and blinker to \>=1.9.0. The build system has switched to flit\_core, and development tooling now includes ruff for linting and uv for dependency management. Example projects (celery, javascript, tutorial) also have their own pyproject.toml files with updated metadata and dependencies.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 69 → 69 (+0.1)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 97 → 96 (-1.5)
- Architecture 97 → 97 (-0.1)
- Maturity 66 → 62 (-3.7)
- Readiness 61 → 61 (+0.0)
- Security 75 → 83 (+7.9)
Resolved (13)
- Confusingly named duplicate: Scaffold (base class for Flask and Blueprint) exposes both get and query as HTTP method decorators. In standard REST conventions and Flask's own routing, 'GET' is the standard term. 'Query' is non-standard and likely a synonym for 'GET', creating unnecessary cognitive load and potential confusion for developers expecting standard HTTP method names.
- Documentation: no installation or build instructions (docs/quickstart.rst)
- Documentation: no project overview (docs/index.rst)
- Documentation: no usage examples (docs/quickstart.rst)
- Duplicate operation: errorhandler (decorator style) and register_error_handler (function style) perform the same function of registering an error handler. While decorator vs. function style is a common pattern, having both on the same class without clear distinction in utility (e.g., one being deprecated) can be confusing. More importantly, errorhandler returns a decorator, while register_error_handler takes the function directly. This is a minor inconsistency in usage pattern but represents the same underlying intent.
- Duplicate operation: make_response is exposed both as a method on the Flask application instance and as a standalone function in the helpers module. This mirrors the url_for inconsistency.
- Duplicate operation: url_for is exposed both as a method on the Flask application instance and as a standalone function in the helpers module. While they share the same signature, exposing the same functionality via two different entry points (instance method vs module-level function) creates redundancy and confusion about which one to use.
- No ADRs found
- Off-boarding risk: anonymized user #1
- Rotate the exposed credentials — git history can't be un-committed
- Secret: generic-api-key (docs/config.rst)
- Secret: generic-api-key (docs/config.rst)
- Secret: generic-api-key (docs/tutorial/deploy.rst)
New (10)
- Edited copy of a member (10 corresponding lines) (src/flask/templating.py)
- Edited copy of a member (21 corresponding lines) (examples/tutorial/flaskr/blog.py)
- Edited copy of a member (25 corresponding lines) (src/flask/app.py)
- Edited copy of a member (7 corresponding lines) (src/flask/app.py)
- High CVE: [GHSA redacted] (examples/celery/requirements.txt)
- Hotspot: src/flask/app.py (src/flask/app.py)
- Medium CVE: [GHSA redacted] (examples/celery/requirements.txt)
- Medium CVE: PYSEC-2026-2151 (examples/celery/requirements.txt)
- No ADRs found (pyproject.toml)
- Off-boarding risk: anonymized user #1
Changes since last survey
- 4 commits — 4 feature/other, 0 fixes
By area
- src/flask — 2 commits
- (repo) — 1 commit
- docs/errorhandling.rst — 1 commit
Notable commits
- change: add versionchanged for ctx signature change
- change: add versionchanged for ctx signature change (#6176)
- change: fix example typo
- change: werkzeug 3.2 compat
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
pallets/flask was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 49943b5a94413a530761350f04e896f76e8d620e — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-36d4cd83012f.