Python | Django Admin

Last Updated :
Discuss
Comments

Question 1

The admin interface is part of which Django app by default?

  • django.contrib.sessions

  • django.contrib.contenttypes

  • django.contrib.auth

  • django.contrib.admin

Question 2

To make a model appear on the admin dashboard what should be done?

  • Add the model name to INSTALLED_APPS only

  • Create a superuser account

  • Register the model in admin.py and run migrations

  • Restart the server

Question 3

Which command is used to create a superuser in Django?

  • python manage.py createuser

  • python manage.py createsuperuser

  • python manage.py makeadmin

  • python manage.py addsuper

Question 4

If a model does not define the str method how does it appear in the admin interface?

  • Shows model name and object id

  • Appears as an empty record

  • Displays field names of the model

  • Shows only the primary key

Question 5

Which attribute is used to display multiple columns for a model in the admin list view?

  • list_fields

  • display_fields

  • fields_display

  • list_display

Question 6

A user who has is_staff set to True but is not a superuser can perform which action?

  • Access the admin panel only for permitted models

  • Access all admin sections

  • Create new models

  • Manage database settings

Question 7

Which attribute is used to enable search functionality for specific fields in the admin panel?

  • list_search

  • search_fields

  • filter_fields

  • query_fields

Question 8

To filter records by availability and published date in the admin list view which attribute is used?

  • filter_set

  • filter_fields

  • list_filter

  • filter_by

Question 9

What kind of users can log in to the admin panel?

  • Any registered user

  • Only superusers

  • Users with is_staff set to True

  • Users with verified email addresses

Question 10

What are the basic operations that can be performed on a model through the admin interface?

  • Add, edit, and delete records

  • Only read records

  • Only add new records

  • Only update existing data

Tags:

There are 12 questions to complete.

Take a part in the ongoing discussion