About Optimal Code Length
If a function or method goes past 30 lines of code, consider breaking it up. A good maximum module size is about 500 lines.
Michael Foord (@voidspace)
Tips and Tricks Programming Wisdom Refactoring Optimization Python 3 JavaScript
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.