Learn About Django Project MVT Structure

Learn About Django Project MVT Structure

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

Learn About Django Project MVT Structure

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.

Learn About Django Project MVT Structure

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.

Learn About Django Project MVT Structure

_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.

Copyrights

We respect the property rights of others and are always careful not to infringe on their rights, so authors and publishing houses have the right to demand that an article or book download link be removed from the site. If you find an article or book of yours and do not agree to the posting of a download link, or you have a suggestion or complaint, write to us through the Contact Us, or by email at: support@freewsad.com.

More About us