CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/django-best-practices

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

1.63x
Quality

87%

Does it follow best practices?

Impact

100%

1.63x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsonevals/scenario-5/

{
  "context": "Tests whether the agent proactively applies Django best practices when building a recipe platform: custom user model, settings splitting, select_related/prefetch_related for the homepage, TextChoices for difficulty, custom manager, app_name, management command best practices. The task describes a feature -- it does NOT name any of 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, even though the task only mentions 'users can register'. The agent was NOT asked for a custom user model.",
      "max_score": 12
    },
    {
      "name": "Settings split into base/dev/prod",
      "description": "Settings are organized into multiple files (base.py, dev.py, prod.py or equivalent) rather than a single settings.py. The agent was NOT asked about settings organization.",
      "max_score": 10
    },
    {
      "name": "select_related for homepage author",
      "description": "The homepage queryset uses select_related('author') or equivalent to load recipe authors without N+1 queries. The agent was NOT asked about query optimization.",
      "max_score": 14
    },
    {
      "name": "prefetch_related for categories or ingredients",
      "description": "Querysets that display recipes with their categories, ingredients, or comments use prefetch_related to avoid N+1 queries. The agent was NOT asked about prefetch_related.",
      "max_score": 12
    },
    {
      "name": "TextChoices for difficulty",
      "description": "The difficulty field uses a TextChoices (or IntegerChoices) class rather than raw string tuples.",
      "max_score": 8
    },
    {
      "name": "app_name in urls.py",
      "description": "Each app's urls.py sets app_name for URL namespacing. The agent was NOT asked about URL namespacing.",
      "max_score": 8
    },
    {
      "name": "settings.AUTH_USER_MODEL for FK",
      "description": "ForeignKey fields to the user use settings.AUTH_USER_MODEL, not django.contrib.auth.models.User directly.",
      "max_score": 10
    },
    {
      "name": "Management command uses self.stdout.write",
      "description": "The management command uses self.stdout.write() for output, not print(). The agent was NOT told how to write management command output.",
      "max_score": 8
    },
    {
      "name": "Management command has help text",
      "description": "The management command class defines a help attribute describing what it does.",
      "max_score": 6
    },
    {
      "name": "related_name on ForeignKey fields",
      "description": "ForeignKey and ManyToManyField relations include related_name for explicit reverse access.",
      "max_score": 6
    },
    {
      "name": "get_object_or_404 in detail view",
      "description": "The recipe detail view uses get_object_or_404 (or equivalent CBV) rather than bare .get().",
      "max_score": 6
    }
  ]
}

evals

tile.json