What is Django?
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。
了解热门 Django 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。
了解热门 Django 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。
搜索问题以查看答案。
收藏此条目、标记为困难题,或将其加入复习集合。
收藏此条目、标记为困难题,或将其加入复习集合。
Most developers prefer Django due to its dominance in the market, as it shows high computational and statistical capabilities. The following are some of the advantages of Django:
收藏此条目、标记为困难题,或将其加入复习集合。
Despite many advantages, developers still find it challenging to make the transition. The following are some disadvantages of using the Django framework:
收藏此条目、标记为困难题,或将其加入复习集合。
收藏此条目、标记为困难题,或将其加入复习集合。
The following are the best features of the Django framework:
收藏此条目、标记为困难题,或将其加入复习集合。
Django follows the Model-View-Template(MVT) architecture based on a popular Model-View-Controller(MVC) architectural pattern, which is followed by popular web-frameworks like Ruby on Rails, Laravel etc.
Django’s Model-View-Template architecture divides the complete application into three major logical components:
All these three components are responsible for handling the different aspects of the web application.
Model: The models handle the database schema for the web applications. It maintains and represents the complete application data into the database. The default relational database used by the model is SQLite which is generally used in development, but in production we can use the MySQL and Postgres.
View: The view component manages all the logic of the application that we want to render on the user’s browser. In Django, the view acts as a bridge between the models and the templates. In the views, we can fetch the data from the models and render it on the template.
Template: The template component is the collection of static parts of the application such as the HTML, CSS, JavaScript, and Image files. The view uses the template as the base on which the data should be presented, because at the end, the web-application uses the static files to represent the content on the user browser.
收藏此条目、标记为困难题,或将其加入复习集合。
The following is the project directory structure in Django:
收藏此条目、标记为困难题,或将其加入复习集合。
The architecture of Django consists of the following components:
收藏此条目、标记为困难题,或将其加入复习集合。
Django is based on the MVT architecture, and since Django is the controller of the architecture, it has defined some rules that all developers need to follow to execute appropriate files at the right time.
In Django, you get great customizability with implementation. But you are not allowed to make changes to the file names, the predefined lists, and variable names. You have to create the new ones, but you can’t make changes to the predefined variables.
The monolithic behavior helps the developers to understand the project easily. Even if the company changes, the project layout will remain the same. Therefore, developers take less time to understand the code, increasing productivity.
收藏此条目、标记为困难题,或将其加入复习集合。
In Django, the packages website is the place where all the third-party applications are uploaded. You can install them in your system.
收藏此条目、标记为困难题,或将其加入复习集合。
Django is a compelling framework and is used by various renowned organizations. Some of the highly trafficked websites using Django are:
收藏此条目、标记为困难题,或将其加入复习集合。
收藏此条目、标记为困难题,或将其加入复习集合。
收藏此条目、标记为困难题,或将其加入复习集合。
The following are the steps that take place when a request is received by 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. |
收藏此条目、标记为困难题,或将其加入复习集合。
Field class types specify the following:
收藏此条目、标记为困难题,或将其加入复习集合。
The following is a list of some companies that use Django:
收藏此条目、标记为困难题,或将其加入复习集合。