# Flask vs Django: source lines of code compared

The Flask vs Django comparison on OctoCounts shows side-by-side source line counts for pallets/flask and django/django, counted with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-20, pallets/flask contains 34,156 total lines (25,636 code) across 210 files, while django/django contains 543,623 total lines (392,744 code) across 3,582 files as of 2026-09-08. django/django is about 15x the size of pallets/flask by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [pallets/flask](https://octocounts.com/github/pallets/flask) | [django/django](https://octocounts.com/github/django/django) |
| --- | ---: | ---: |
| Files | 210 | 3,582 |
| Total lines | 34,156 | 543,623 |
| Code lines | 25,636 | 392,744 |
| Comment lines | 985 | 44,971 |
| Blank lines | 7,535 | 105,908 |
| Languages counted | 12 | 12 |

Top languages in pallets/flask: Python (54.6% of code), ReStructuredText (42.2% of code), TOML (1.3% of code). Top languages in django/django: PO File (60.8% of code), Python (31.1% of code), Modelica (5.6% of code). Python, CSS appear in both top language lists; ReStructuredText, TOML, HTML appear only in pallets/flask's top languages; PO File, Modelica, JavaScript appear only in django/django's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. pallets/flask was counted at ref main (commit d73fa1cdcbd8) on 2026-09-20; django/django was counted at ref 802baf5da5b8d8b44990a8214a43b951e7ab8b39 (commit 802baf5da5b8) on 2026-09-08. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

pallets/flask counts the Flask core repository — the Python microframework itself, deliberately small, with extensions and documentation largely maintained in separate repositories under the same organization. django/django counts the Django repository: the full-stack web framework with its ORM, admin, forms, templating, and contrib modules all in one tree. The comparison is minimal-core vs batteries-included monorepo, so the counts differ in what they include by design.

Both repositories are Python codebases, as the per-language tables confirm; the size gap between them is structural — Django ships its ORM, admin interface, and contrib modules in the counted tree, while Flask's core keeps comparable functionality in external packages that are not counted.

Reading Flask's count against Django's as if both covered the same scope understates the Flask ecosystem: a substantial amount of Flask-adjacent library code exists in repositories that are not part of either counted archive.

_A smaller core does not mean a smaller finished application: the application code plus the extensions it pulls in determine the real total, so these counts compare framework cores, not application stacks._

Sources: [pallets/flask repository](https://github.com/pallets/flask) · [django/django repository (full-stack framework incl. contrib)](https://github.com/django/django). Statements verified 2026-09-16.

Evidence and next steps:

- [pallets/flask SLOC report](https://octocounts.com/github/pallets/flask)
- [django/django SLOC report](https://octocounts.com/github/django/django)
- [Compare pallets/flask and django/django interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fpallets%2Fflask&right=https%3A%2F%2Fgithub.com%2Fdjango%2Fdjango)

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

## Compare FAQ

### Which has more lines of code, pallets/flask or django/django?

django/django has more code: 392,744 code lines versus 25,636 for pallets/flask, about 15x as much, based on cached OctoCounts reports as of 2026-09-20.

### Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for pallets/flask, django/django, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. pallets/flask was counted at ref main (commit d73fa1cdcbd8) on 2026-09-20; django/django was counted at ref 802baf5da5b8d8b44990a8214a43b951e7ab8b39 (commit 802baf5da5b8) on 2026-09-08. See the counting methodology for ignored directories and analysis options.

### Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [OctoCounts API docs](https://octocounts.com/docs/api)
