热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

Django 面试题与答案

Test your skills through the online practice test: Django Quiz Online Practice Test

问题 36. What are signals in Django?

Signals are pieces of code that hold information regarding what is happening. You can use a dispatcher for sending the signals and listening to those signals. 

The signals become very useful when we want to do something with the data, before or after a certain event occurs.

Here is the list of events on which we can use the Django signals:

  • pre_save() trigger before save().
  • post_save() trigger after save().
  • pre_delete() trigger before delete().
  • post_delete() trigger after delete().
  • m2m_changed() triggers when there is a change in ManyToMany Field.
  • request_started() trigger when the django starts the HTTP request.
  • request_finished() trigger when the django finishes the HTTP request.

这有帮助吗? 添加评论 查看评论
 

问题 37. What are some important parameters of signals?

The following are the two important parameters of signals:

  • Receiver: It specifies the callback function connected to the signal
  • Sender: It specifies a particular sender from where a signal is received

这有帮助吗? 添加评论 查看评论
 

问题 38. What is mixin in Django?

Mixin is a type of multiple inheritances that combines the behaviors and attributes of more than one parent class. It provides an excellent way of reusing the code from multiple classes.

For example, generic class-based views have a mixin called TemplateResponseMixin. This mixin is used for defining the render_to_response() method. When you combine it with a class present in the View, it results in a TemplateView class.

The only drawback of mixin is that it becomes difficult to analyze what a child class is doing and which methods to override if its code scatters between multiple classes.

这有帮助吗? 添加评论 查看评论
 

问题 39. What are caching strategies in Django?

Caching implies storing the output of calculations to avoid performing the same calculations repetitively. Django comes with a robust cache system helping to create dynamic pages. Therefore, it eliminates the need to evaluate pages repeatedly for every request. The following table highlights some of the significant caching strategies:


Strategy

Description

Memcached

It is a memory-based cache server.

Filesystem caching

This caching strategy helps in caching the values stored as separate files in a serialized order.

Local-memory caching

It is the default cache, and it is used if you have not specified any other. It is a per-process and thread-safe cache.

Database caching

The database stores the cache data.

这有帮助吗? 添加评论 查看评论
 

问题 40. What is the manage.py file in Django?

Whenever you create a project, the manage.py file is automatically created. This is a command-line utility, helping you to interact with your Django project. It performs the same work as Django-admin and sets the DJANGO_SETTINGS_MODULE environment variable to point to your project’s settings. It is better if you use manage.py instead of Django-admin if you are working on a single project.

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。