Hacker News new | ask | show | jobs
by Daishiman 4518 days ago
I honestly think this guy doesn't get it.

The proper way to separate concerns in Django is through applications, which have their own URL routes, models, and views (although they can invoke any other thing in another app).

Through Class-based views you can define base views for common behavior for templates and basic logic, and the built-in views are usually good enough to contain most patterns and easy enough to customize for any other use case you might think of.

A good rule of thumb is that an application should generally have less than a dozen views (I'd say 5 or 6 is enough already). Since each app has its own forms and models file, adding utility methods in an extra file contained within an app is reasonable.

I've used this to manage Django apps with over 50.000 lines of custome code (not counting several dozen extra apps and admin sites with their own customization) and it has never been a problem.

Fat models are just a massive problem. If Python supported extension methods then perhaps you could load your own extensions when performing an action, but a proper design of forms and views that aims for maximum simplity has never failed me.