Learn About Django Project MVT Structure
![Learn About Django Project MVT Structure Learn About Django Project MVT Structure](https://api.facepy.com//media/posts/PNG/2023-06-04/2f10039cf8d54165a6bc2b99183241da.png)
At 6/4/2023
Django is based on the MVT (Model-View-Template) architecture. MVT is a software design pattern for developing a web application.
The MVT structure consists of the following three parts.
Model: The model will act as the interface to your data. He is responsible for data maintenance. It is the logical data structure behind the whole application and is represented by a database (usually relational databases such as MySql and Postgres). To learn more, visit – Django Templates
View: The view is the user interface what you see in your browser when viewing a website. It is represented by HTML/CSS/Javascript and Jinja files. To learn more, visit – Django Views.
Template: A template consists of static parts of the desired HTML output as well as special syntax describing how the dynamic content will be inserted. To learn more, visit Django Templates
A Django project when initialized contains basic files such as manage.py, view.py, etc. by default. A simple project structure is enough to create a single page application. Here are the main files and their explanations. In the geeks_site folder (project folder) there will be the following files.
manage.py- This file is used to interact with your project through the command line (start the server, synchronize the database…etc). To get the full list of commands that manage.py can run, type this code in the command window.
$ python manage.py helps
folder ( geeks_site ) This folder contains all the packages for your project. Initially, it contains four files.
_init_.py - This is a python package. It is called when the package or a module of the package is imported. We usually use it to execute package initialization code, for example for package-level data initialization.
settings.py - As the name suggests, it contains all website settings. In this file, we save all the applications we create, the location of our static files, database configuration details, etc.
urls.py - In this file we store all project links and functions to call.
wsgi.py - This file is used to deploy the project in WSGI. It is used to help your Django application communicate with the web server.