Django

Django Fundamentals

MVT pattern, project structure, settings.py, urls.py, views, templates, static files

20 câu hỏi phỏng vấn·
Junior
1

What does the MVT acronym stand for in Django architecture?

Câu trả lời

MVT stands for Model-View-Template. It is Django's architectural pattern, similar to MVC but with different terminology. The Model handles data and business logic, the View processes requests and returns responses, and the Template handles HTML presentation. Django uses this separation of concerns to organize code in a clear and maintainable way.

2

Which command should be used to create a new Django project named 'myproject'?

Câu trả lời

The command django-admin startproject project_name creates a new Django project with the basic structure. This command generates the project directory containing manage.py (management script) and a subdirectory with settings.py, urls.py, asgi.py and wsgi.py. It is recommended to activate a virtual environment before running this command.

3

Which file contains the main configuration of a Django project, such as database and installed applications?

Câu trả lời

The settings.py file contains all the Django project configuration. It includes INSTALLED_APPS for active applications, DATABASES for database connection, MIDDLEWARE for middleware layers, TEMPLATES for template configuration, and many other options like SECRET_KEY, DEBUG, ALLOWED_HOSTS and security settings.

4

In Django's MVT architecture, which component is responsible for processing HTTP requests and generating responses?

5

Which command is used to start the Django development server?

+17 câu hỏi phỏng vấn

Nắm vững Django cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí