I’m just getting started with web development and trying to understand MVC architecture better.
I’ve been learning Django and I think it follows the MVC pattern. From what I understand:
- Models handle the data and database stuff
- Views take care of displaying content to users
- Controllers manage the logic between models and views
But I’m confused about something. If Django already handles the presentation layer, why do people use frontend frameworks like React or Vue? How do these client-side tools implement MVC differently?
I want to create a basic blog website. Should I stick with just Django templates or add a frontend framework too? Are there real websites that use MVC on both the server and client sides?
Any examples or simple explanations would help me understand this better.
Wait, are users gonna be commenting or interacting a lot with ur blog? That’d help narrow down the tech stack. What kind of content are u thinking - just text or multimedia too? Django templates work fine, but what’s ur long-term plan here?
Django uses MTV (Model-Template-View) instead of traditional MVC, though they’re pretty similar. The naming throws people off because Django’s Views basically do what Controllers do in MVC. React doesn’t really follow MVC either - it’s component-based where each component handles its own state and rendering. You can add MVC patterns with Redux or MobX if you want. For your blog project, Django templates will work great and give you a solid foundation. Adding React introduces complexity you probably don’t need for a basic blog. Tons of successful sites stick with server-side rendering. Once you’re comfortable with Django, you can always decouple later using Django REST Framework to create APIs for React or Vue. That’s what bigger apps do when they need more interactive UIs.
mvc seems tough at first, but you’ll get it. just stick with django templates for now, don’t complicate things with react or vue yet. build ur blog with basic django, learn how it all fits, then add js later if u need more interactivity.