Django patterns -- custom user model, project structure, models, views, URL routing, select_related/prefetch_related, signals vs save(), middleware, settings splitting, custom managers, management commands
92
87%
Does it follow best practices?
Impact
100%
1.63xAverage score across 5 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent proactively applies Django best practices when building a bookstore catalog: custom user model, select_related for FK joins, prefetch_related for M2M, app_name, custom manager for available books, save() for computed fields, management command patterns. The task is a business description -- it does NOT name these patterns.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Custom user model",
"description": "The project defines a custom user model inheriting from AbstractUser and sets AUTH_USER_MODEL in settings. The agent was NOT asked for a custom user model.",
"max_score": 12
},
{
"name": "select_related for book author on catalog",
"description": "The catalog page queryset uses select_related('author') to load author names alongside books without N+1 queries. The agent was NOT asked about query optimization.",
"max_score": 14
},
{
"name": "prefetch_related for genres",
"description": "The catalog or detail queryset uses prefetch_related('genres') or equivalent to load genres without N+1 queries when displaying them per book.",
"max_score": 12
},
{
"name": "prefetch_related for reviews on detail",
"description": "The book detail queryset uses prefetch_related for reviews (and optionally their authors) to avoid N+1 queries when listing reviews.",
"max_score": 10
},
{
"name": "app_name in urls.py",
"description": "Each app's urls.py sets app_name for URL namespacing.",
"max_score": 8
},
{
"name": "settings.AUTH_USER_MODEL for FK",
"description": "ForeignKey fields to the user model use settings.AUTH_USER_MODEL, not a direct import of User.",
"max_score": 10
},
{
"name": "get_object_or_404 in detail views",
"description": "The book detail and author detail views use get_object_or_404 (or equivalent CBV).",
"max_score": 8
},
{
"name": "Management command uses self.stdout.write",
"description": "The stock management command uses self.stdout.write() for output, not print().",
"max_score": 6
},
{
"name": "Management command accepts arguments",
"description": "The management command uses add_arguments to accept the stock threshold as a command-line argument.",
"max_score": 6
},
{
"name": "related_name on ForeignKey and M2M",
"description": "ForeignKey and ManyToManyField relations include related_name.",
"max_score": 6
},
{
"name": "auto_now_add/auto_now timestamps",
"description": "Models use auto_now_add for created_at and/or auto_now for updated_at timestamps.",
"max_score": 4
},
{
"name": "get_absolute_url on Book model",
"description": "The Book model defines get_absolute_url() using reverse() with a namespaced URL.",
"max_score": 4
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
django-best-practices
verifiers