πŸ“Š Django
Q. What is Django primarily used for?
  • (A) Data analysis
  • (B) Game development
  • (C) Web development
  • (D) Mobile app development
πŸ’¬ Discuss
βœ… Correct Answer: (C) Web development

Explanation: Django is a high-level Python web framework used for rapid web application development.

πŸ“Š Django
Q. Which programming language is Django based on?
  • (A) Java
  • (B) Python
  • (C) Ruby
  • (D) PHP
πŸ’¬ Discuss
βœ… Correct Answer: (B) Python

Explanation: Django is written in Python and follows the Python programming principles.

πŸ“Š Django
Q. What does MTV stand for in Django architecture?
  • (A) Model Template View
  • (B) Model Table View
  • (C) Module Template View
  • (D) Model Template Variable
πŸ’¬ Discuss
βœ… Correct Answer: (A) Model Template View

Explanation: In Django, MTV stands for Model, Template, and View - similar to MVC architecture.

πŸ“Š Django
Q. Which file is used to define URL patterns in a Django project?
  • (A) urls.py
  • (B) routes.py
  • (C) navigation.py
  • (D) path.py
πŸ’¬ Discuss
βœ… Correct Answer: (A) urls.py

Explanation: In Django, URL patterns are defined in the urls.py file.

πŸ“Š Django
Q. Which command is used to start a new Django project?
  • (A) django-start
  • (B) python startproject
  • (C) django-admin startproject
  • (D) python admin startproject
πŸ’¬ Discuss
βœ… Correct Answer: (C) django-admin startproject

Explanation: The correct command is: django-admin startproject projectname.

πŸ“Š Django
Q. Which of the following is the correct command to create a Django app?
  • (A) django-admin startapp appname
  • (B) python createapp appname
  • (C) python admin startapp appname
  • (D) django-admin createapp appname
πŸ’¬ Discuss
βœ… Correct Answer: (A) django-admin startapp appname

Explanation: The correct command to create an app in Django is `django-admin startapp appname`.

πŸ“Š Django
Q. Which file contains database configuration settings in Django?
  • (A) manage.py
  • (B) settings.py
  • (C) urls.py
  • (D) models.py
πŸ’¬ Discuss
βœ… Correct Answer: (B) settings.py

Explanation: Database configurations in Django are set in `settings.py`.

πŸ“Š Django
Q. Which command applies migrations to the database?
  • (A) python manage.py dbmigrate
  • (B) python manage.py migrate
  • (C) python manage.py syncdb
  • (D) python manage.py makemigrations
πŸ’¬ Discuss
βœ… Correct Answer: (B) python manage.py migrate

Explanation: `migrate` applies migrations to the database after they've been created.

πŸ“Š Django
Q. What is the purpose of Django’s `manage.py` file?
  • (A) Handles HTTP requests
  • (B) Configuration of settings
  • (C) Provides a command-line interface for administrative tasks
  • (D) Defines the URL patterns
πŸ’¬ Discuss
βœ… Correct Answer: (C) Provides a command-line interface for administrative tasks

Explanation: `manage.py` is used to execute Django-specific commands from the command line.

πŸ“Š Django
Q. Which Django feature is used for defining database structure?
  • (A) Templates
  • (B) Views
  • (C) Models
  • (D) Forms
πŸ’¬ Discuss
βœ… Correct Answer: (C) Models

Explanation: Models in Django define the structure of the database.