Python3 Development of Advanced-django framework

Source: Internet
Author: User

I. MVC framework and MTV framework

MVC, the full name of the model View Controller, is a software architecture model in software engineering that divides a software system into three basic parts:

Models, views, and controllers (Controller) have the advantages of low coupling, high reusability, and low life cycle cost.

The essence of MVC is to organize code in a way that separates business logic, data, and interfaces, and aggregates business logic into a single component,

There is no need to rewrite business logic while improving and customizing the interface and user interaction.

Want to learn more about the MVC pattern? >> Talk about MVC patterns

The Django Framework's MTV model is essentially no different from the MVC framework, and is divided into three parts to reduce the coupling between the various parts.

The Django framework differs in that it splits three parts: model, template, and view, which is the MTV framework.

Django's MTV Model

Model: Object that is responsible for business objects and databases (ORM)

Template (Template): Responsible for how to display the page to the user

View: Responsible for business logic, and call model and template when appropriate

In addition, Django has a URL dispatcher that distributes page requests for URLs to different view processes, and the view calls the corresponding model and template

Django Framework Diagram

APP

A Django project can be divided into a number of apps that isolate the code for different function modules.

Command line creation
Python manage.py Startapp app01# The names of various apps
Create with Pycharm

Click here for more information

In the command window that pops up below, enter:

Startapp APP01
Routing system

Django Routing system >> point I later update

View System

Django View system >> point me

Template

Templates (template) system >> points I follow update

Model

Model system ORM >> dot Me

Python3 Development of Advanced-django framework

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.