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

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

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

面试准备

Django 面试题与答案

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

问题 46. What types of exception classes are there in Django?

The following are the exception classes available in Django:

Exception

Description

AppRegistryNotReady

Raised when we try to use models before the app loading process.

ObjectDoesNotExist

Base class for DoesNotExist exceptions.

EmptyResultSet

Raised if a query does not return any result.

FieldDoesNotExist

Raised if the requested field does not exist.

MultipleObjectsReturned

A query will raise this exception if only one object is expected, but multiple objects are returned.

SuspiciousOperation

Raised when a suspicious operation has been performed by the user.

PermissionDenied

Raised when a user does not have an appropriate permission to perform a specified action.

ViewDoesNotExist

Raised by django.urls if the requested view does not exist.

MiddlewareNotUsed

Raised if a middleware is not used in the server configuration.

ImproperlyConfigured

Raised if Django is somehow improperly configured.

FieldError

Raised if there is a problem with a model field.

ValidationError

Raised if the data validation fails to form or model field validation.

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

问题 47. What are the specific Django field class types?

Field class types specify the following:

  • The database column type.
  • The default HTML widget for availing while rendering a form field.
  • The minimal validation requirements used in Django admin that helps in automatically generated forms.

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

问题 48. What are the different types of views available in Django?

The following are the two different types of views available in Django:

  • Function-Based Views: It lets you import a view as a function
  • Class-based Views: It is an object-oriented approach

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

问题 49. Which companies use Django?

The following is a list of some companies that use Django:

  • PBS
  • Instagram
  • Mozilla
  • The Washington Times
  • Disqus, Bitbucket
  • NextDoor
  • YouTube
  • Pinterest
  • DISCUS

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

问题 50. What is a model in Django?

A Model is specified as a Python class derived from the Model class. This model class is imported from the django.db.models library. The main concept of Django Models is to create objects for storing data from a user in a user-defined format.

The model class is a pre-defined class with lots of benefits. You can define the field with specific attributes as you can do in SQL, but the same can also be achieved in Python.

This class is parsed by Django ORM or backend engine, and there is no need to do anything related to a database, such as creating tables and defining fields afterward mapping the fields with the attribute of the class.


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

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

版权所有 © 2026,WithoutBook。