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

task.mdevals/scenario-3/

Online Bookstore Catalog

Problem/Feature Description

Build a bookstore catalog with Django. The store sells books organized by genre and author. The catalog page shows books with their authors and genres. Customers can add reviews. Staff can manage inventory through the admin and a custom command.

Requirements:

  1. Users can register and browse the catalog
  2. Books have a title, ISBN, price, description, publication year, and stock quantity
  3. Each book has one primary author and can belong to multiple genres
  4. Authors have a name and biography
  5. Genres have a name and description
  6. Registered users can write reviews on books (rating 1-5 plus text)
  7. The catalog page at /books/ shows books with author names and genres, paginated (20 per page)
  8. Each book has a detail page at /books/<slug>/ showing all information, reviews with reviewer names, and average rating
  9. An author page at /authors/<slug>/ shows the author bio and all their books
  10. A management command to flag books with stock below a threshold

Output Specification

Produce Python source files in a bookstore/ directory:

  • Settings configuration
  • URL configuration
  • App files with models, views, urls, forms, admin
  • Templates directory
  • The management command
  • manage.py

Do not run migrations or start the server.

evals

tile.json