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

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

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

面试准备

Django 面试题与答案

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

问题 31. How can you set up the database in Django?

You can edit mysite/setting.py, a module representing Django settings. By default, Django uses SQLite, which is easy to use and does not require any type of installation.

If your database choice is different, you have to do the following keys in the DATABASE ‘default’ item for matching your database connection settings:

  • Engines: You can make the changes to the database using ‘django.db.backends.sqlite3’, ‘django.db.backeneds.mysql’, ‘django.db.backends.postgresql_psycopg2’, ‘django.db.backends.oracle’, and so on.
  • Name: If you use SQLite as your database, the database file will be on your computer. The name should be a full absolute path, including the file name of that file.

But, if you do not choose SQLite, you need to add the settings such as Password, Host, User, etc.

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

问题 32. How can you set up static files in Django?

For setting up the static files in Django, you need to consider the below steps:

  • Firstly, set the STATIC_ROOT in the settings.py file
  • Run the manage.py collectsatic file
  • Finally, set up a Static Files entry on the PythonAnywhere web tab

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

问题 33. What is the session framework in Django?

Django comes with the session framework helping to store and retrieve the arbitrary data on a per-site-visitor basis. It saves all data on the server-side and abstracts the receiving and sending of cookies. You can implement the session via middleware.

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

问题 34. How many types of inheritance styles are in Django?

Django has three inheritance styles, as mentioned below.

  • Abstract base classes: You can use this style when you want a parent’s class to only store the information you don’t want to use for each child model
  • Multi-table Inheritance: You can use this style If you are subclassing an existing model and need each model to have its database table.
  • Proxy models: You can use this model if you only want to change the Python level behavior of the model without the need to change the model’s fields

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

问题 35. What are the applications of middleware in Django?

The following are some applications of middleware in Django:

  • Session management
  • User authentication
  • Cross-site request forgery protection
  • Content gzipping

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

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

版权所有 © 2026,WithoutBook。