Search⌘ K
AI Features

Improve Performance

Explore methods to enhance Django Admin performance by optimizing foreign key retrieval. Learn to use list_select_related to reduce database queries and implement autocomplete_fields or raw_id_fields to handle large foreign key datasets efficiently.

Retrieving foreign key

If your model has a foreign key (like the Author for our Question model or Question for our Choice model), set list_select_related to instruct Django to use select_related() in retrieving the list of objects on the admin change list page. ...