Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

A brief introduction to the Django Framework

Shulou Source: shulou.com Published: 2022-06-02 04:42:25 10月04日 Update

This article mainly explains the "brief introduction of the Django framework", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn the "brief introduction of the Django framework" bar!

MVC framework and MTV framework

MVC, whose full name is Model View Controller, is a software architecture pattern in software engineering. It divides the software system into three basic parts: Model, View and Controller. It has the advantages of low coupling, high reusability and low life cycle cost.

The difference of the Django framework is that it is divided into three parts: Model (model), Template (template) and View (view), that is, the MTV framework.

MTV mode of Django

Model (model): objects responsible for business objects and databases (ORM)

Template (template): responsible for showing the page to the user

View (View): responsible for the business logic and invoking Model and Template when appropriate

In addition, Django also has a urls dispenser, which distributes URL page requests to different view processing, and view calls the corresponding Model and Template

Django frame diagram

APP

A Django project can be divided into many APP to isolate the code of different functional modules.

Command line creation APPpython manage.py startapp app name using PyCharm creation

Enter: startapp app name in the command window that pops up below

Thank you for your reading, the above is the content of the "brief introduction of the Django framework", after the study of this article, I believe you have a deeper understanding of the simple introduction of the Django framework, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Framework different model view software learning business content name command object pattern page appropriate three that is code advantage function full name Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MariaDB Shulou Information vpn Microsoft