Sankofa Journal Step 7: Real Queries

Replace the hard-coded lists in your views with real queries. The index shows published posts newest first, the tag and author views filter accordingly, and the detail view uses get_object_or_404. Then install Django Debug Toolbar and look at the query count on the index page. Fix whatever N+1 you find with select_related or prefetch_related, and write down the before and after numbers. That measurement is the whole point of the exercise.

SANKOFA SANDBOX
loading editor…
Your turn → Work through it step by step. This is a piece of the course project, not a throwaway exercise.

Built it in both languages?

Mark it done once your Python and JavaScript versions both run correctly. Honesty here is what makes the dashboard useful to you.

← BackNext: Module 8: Forms →