程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

02 Django basic introduction to Django

編輯:Python

Django Introduce

      • Preface
      • brief introduction
      • characteristic
        • 1) Heavyweight framework
        • 2 ) MVT Pattern


Preface

  • This article is about writing Django

brief introduction

  • Django Yes, it is python Open source for language writing web Development framework , And follow MVC Design . It was originally designed for news sites with rapid development needs , The purpose is to achieve simple and fast website development .
  • Django The main purpose of is to be simple 、 Fast development of database driven websites . It emphasizes code reuse , Multiple components can be easily used to “ plug-in unit ” Form serves the whole framework ,Django There are many powerful third-party plug-ins , You can even easily develop your own toolkit · This makes Django It has strong expandability · It also emphasizes rapid development and DRY(DoNotRepeatYoursel) principle .

characteristic

1) Heavyweight framework

  • contrast Flask frame ,Django Native provides many functional components , Make development easier and faster .
    • Provides automated scripting tools for project management
    • database ORM Support ( Object relation mapping , English :Object Relational Mapping)
    • Templates · Forms
    • Admin Manage site
    • file management · Authentication authority
    • session Mechanism
    • cache

2 ) MVT Pattern

  • There is a programming pattern called MVC, Its core idea is division of labor 、 decoupling , Reduce coupling between different code blocks , Enhance code scalability and portability , Backward compatibility .
  • MVC Mode description
  • M Put it all together Model, It mainly encapsulates the access to the database layer , Add data in the database 、 Delete 、 Change 、 Check operation .
  • V Put it all together View, Used to encapsulate results , Generate page displayed html Content :
  • C Put it all together Controller, For receiving requests , Process business logic , And Model and View Interaction , Return results .
  • DjangoMVT
  • M Put it all together Model, And MVC Medium M Function the same , Responsible for interacting with database , Data processing .
  • V Put it all together View, And MVC Medium C Function the same , Receiving request , Conduct business processing , Back to answer .
  • T Put it all together Template, And MVC Medium V Function the same , Responsible for encapsulating the returned html:

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved