Django vs Ruby on Rails: source lines of code compared
As of 2026-08-14, django/django contains 558,393 total lines (404,859 code) across 3,624 files, while rails/rails contains 302,643 total lines (136,455 code) across 1,857 files as of 2026-08-14. django/django is about 3.0x the size of rails/rails by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.
| Metric | django/django | rails/rails |
|---|
| Files | 3,624 | 1,857 |
| Total lines | 558,393 | 302,643 |
| Code lines | 404,859 | 136,455 |
| Comment lines | 45,589 | 114,966 |
| Blank lines | 107,945 | 51,222 |
| Languages counted | 12 | 12 |
Top languages in django/django: PO File (59.5% of code), Python (31.9% of code), Modelica (5.5% of code). Top languages in rails/rails: Ruby (86.8% of code), JavaScript (8.6% of code), Rakefile (1.4% of code). JavaScript appears in both top language lists; PO File, Python, Modelica, CSS appear only in django/django's top languages; Ruby, Rakefile, Sass, Ruby HTML appear only in rails/rails's top languages.
Methodology: both counts come from cached OctoCounts reports generated with tokei. django/django was counted at ref main (commit 812c08bd4e9d) on 2026-08-14; rails/rails was counted at ref main (commit d72a482ea458) on 2026-08-14. See the counting methodology for ignored directories and analysis options.
Evidence and next steps:
Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.