Discuss Django architecture.

By ayush goel in 22 Sep 2023 | 04:14 pm
ayush goel

ayush goel

Student
Posts: 346
Member since: 21 Sep 2023

Discuss Django architecture.

22 Sep 2023 | 04:14 pm
0 Likes
divas goyal

divas goyal

Student
Posts: 453
Member since: 22 Sep 2023

Django follows the Model-View-Controller (MVC) architectural pattern, though it uses slightly different naming. In Django's interpretation, it's often referred to as the Model-View-Template (MVT) pattern. Let's break down Django's architecture:


1. Model (M in MVC/MVT)

   - Represents the data structure.

   - Defined as Python classes that subclass `django.db.models.Model`.

   - Represents tables in the database.

   - Allows for data validation, querying, and other database operations using Django's ORM (Object-Relational Mapping).


2. View (C in MVC, V in MVT

   - Handles the user input and controls what is to be displayed in the output.

   - Defined as Python functions or classes that accept a web request and return a web response.

   - Can perform operations using the model and pass the results to a template

22 Sep 2023 | 06:05 pm
0 Likes

Report

Please describe about the report short and clearly.