reading-notes

My reading notes journal for Code Fellows

View the Project on GitHub

Read Class 26: Intro to Django

How Django Works Behind the Scenes

Cited from: https://www.djangoproject.com/start/ 

How Django Works Behind the Scenes

Django Diagram

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!

Cited from: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Introduction 

Things I want to know more about

References