1.

Can you explain the working philosophy of Django?

Answer»

The Django follows "Batteries included" philosophy which provides almost everything developers want to try "out of the box". Everything you need to develop an APPLICATION is part of the one product, and it works seamlessly together, and also follows CONSISTENT design principles.

Django’s working philosophy BREAKS into many components - 

  • Models.py file: Using Python object Django web applications manage and query data and is referred to as models. It defines the structure of stored data along with field types, default values, selection list options, maximum size, label text for forms, ETC. Once you select what database you want to use, you just need to write model structure and other code, Django handles all the work of communicating with the database.
  • Views.py file: Views are the main part of Django and the actual processing happens in view. For searching database, Django model provides simple query API. It can match the number of fields at a time using different criteria and can support complex statements.
  • Urls.py file: It uses a regular expression to capture URL patterns for processing. Django allows you to design URLs the way you want, with no framework limitation.

When a user sends a request on Django page:

  • Django runs through each URL pattern in order and stops at first one pattern that matches with, URL you have created and uses the information to RETRIEVE the view.
  • The view processes the request and queries database if required.
  • Requested information to your template.
  • The template renders the data in a format you have created and displays the page.


Discussion

No Comment Found