상세 컨텐츠

본문 제목

Django Architecture

Django

by BenzhaminKim 2020. 10. 29. 12:38

본문

  • URLs: While it is possible to process requests from every single URL via a single function, it is much more maintainable to write a separate view function to handle each resource. A URL mapper is used to redirect HTTP requests to the appropriate view based on the request URL. The URL mapper can also match particular patterns of strings or digits that appear in a URL and pass these to a view function as data.
  • View: A view is a request handler function, which receives HTTP requests and returns HTTP responses. Views access the data needed to satisfy requests via models, and delegate the formatting of the response to templates.
  • Models: Models are Python objects that define the structure of an application's data, and provide mechanisms to manage (add, modify, delete) and query records in the database. 
  • Templates: A template is a text file defining the structure or layout of a file (such as an HTML page), with placeholders used to represent actual content. A view can dynamically create an HTML page using an HTML template, populating it with data from a model. A template can be used to define the structure of any type of file; it doesn't have to be HTML!

'Django' 카테고리의 다른 글

Django with Docker  (0) 2021.01.15
Relationship between URLS and VIEWS  (0) 2020.10.29
Set Global Variable using settings.py  (0) 2020.10.29
Django URL with View  (0) 2020.10.29

관련글 더보기

댓글 영역