Q1. What Architecture Django follows ?
Django follows model-template-view (MTV) architectural pattern.
Q2. What is difference between MVT and MVC?
Difference Between MVT & MVC
MVT: The full form of MVT is Model-View-Template.MVT has a similar approach to that of MVC. Unlike MVC, the MVT itself handles the controllers.
MVC: The full form of MVC is Model-View-Controller. The purpose of MVC is improving code scalability, reducing coupling between code blocks and decoupling.MVC helps the developers to change the visual part of the app and the business logic in a separate way.
Q3. What are Middlewares? Lists some important Middlewares you have used in Django?
Q4. What is Decorator? How to write custom decorator in Django ?
Q5. What is the usage of ALLOWED_HOST in Django project settings?
Q6. What is Inheritance in Models ?
Q7. What are signals in Django?
Django has a "signal dispatcher" that helps support applications that are decoupled to get informed whenever actions take place elsewhere in a framework. In short, signals allow some senders to inform the set of receivers the action that has occurred. They’re especially beneficial when many parts of code may be involved in the same issues. Django renders a set of inbuilt signals that allows user code to get informed by Django itself of specific actions.
Q8. When to use the iterator in Django ORM?
Q9. Explain mixins in Django?
Mixins are in-built class-based views of Django render numerous functionalities but even then some of them can be needed to use separately. For example, a user wants to write a view such that it will provide a template to initiate an HTTP response, but the TemplateView can not be used, then the user will need to provide a template on POST only whereas GET would be doing something completely different. For this cause, Django also renders plenty of mixins that give added discrete functionality.
Q10. How to create an Constant in Django?
Q11. What are Class-based views in Django?
Class-based views in Django offers a different way to execute views like Python objects as a substitute for functions. It is known that views are callable, and it receives a request while returning a response. It permits you to structure the views and repeat the code by utilizing mixins and inheritance.
Hence, class-based views permit you to answer various HTTP request procedures with various class instance processes sans conditionally bifurcating code within a single or a targeted view function. However, Class-based views do not substitute function-based views although there are points of advantages and differences between function-based and Class-based views.
Q12. How to Configure Database in Django.
Q13. What constitutes Django templates?
Django offers a suitable way to produce active HTML pages by the usage of its template methodology. A template comprises static fragments of the aspired HTML output along with few special syntaxes detailed with the instruction regarding the insertion of dynamic contents. Django templates utilize its possessed syntax to assign tags, variables, and expressions, etc. The templates are provided with contexts that are utilized to acquire merit at web pages. Thus, a Django template constitutes variables that in succeeding time can be restored by values when the template has been evaluated with tags that control the template’s logic.