Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You do realize that django is MVC, but that templates are not the C right? Their naming convention is kinda terrible, but the M is the models (obviously), the V is the templates (the "views") and the C is the views.py file (this is the poorly named part). If you compare to other MVC systems, those are the appropriate parts of django.


Roles are mixed in Django almost without exception. I blame this on the fact that you want to make changes to M, V, and C during a UI interaction while usually only one URL gets called, and so the view updates the M, V, and C. It's like having a layer cake to keep things separate and then cutting it from the top into pie-slices. Sure it makes sense somewhat, but each slice now contains every layer. That is typical web programming.

Unless you're using class-based views or Meteor etc AND hybrid-style API's, things aren't even beginning to resemble application programming with a separate network aspect to the application. These days I'd just about rather print HTML/CSS onto paper so I can at least burn it. The whole web-standards movement never grasped me as egalitarian or a good way to get FOSS into closed platforms. I know there are supporters to web, but basically I view web as pretty limited in spite of all the work that's been done with it.

Templates in Django are nothing that I would call views in application programming. If I use data binding to hook up my controller state (in some way a wrapper around the model), then this has nothing to do with the M, V, or T in Django. It's a js object and not part of Django at all.

Templates are a decent way to somewhat modularize HTML/CSS without falling back to generating HTML/CSS from objects and giant data-structures, which would be torture. This is not what views do.


I prefer to think of it as: M is obvious, V is views and templates, C is handled by django and if you need to to custom "C" stuff (which is fairly rare) you intercept the request/response flow with middleware.

Your mapping, Djano's MTV ~= MVC (in that order), is not a bad way to build your conceptual model.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: