$ show stephenmcd/mezzanine
Mezzanine is a mature, full-featured content management system built on Django. It provides a hierarchical page tree with drag-and-drop ordering, a blogging engine with RSS/Atom feeds and importers from WordPress/Blogger/Tumblr, a dynamic form builder with CSV export, threaded comments with Akismet spam filtering, ratings, keywords/tags, user accounts with email verification and approval workflows, and inline editing via TinyMCE. The architecture is modular: core apps (pages, blog, forms, generic, accounts, twitter, galleries) are all Django reusable apps that integrate with the admin. Mezzanine's key innovation is a database-backed settings system where most configuration can be changed live through the admin interface, and a two-phase caching strategy that combines template fragment caching with a 'nevercache' tag for dynamic content. The codebase follows standard Django patterns (class-based views, managers, template tags, middleware) and is heavily internationalized (30+ languages). It is a production-grade CMS but shows its age in some vendored frontend libraries (jQuery 3.4.1, Bootstrap 3, TinyMCE 4.x) and contains deprecated modules (mobile, twitter).
The LLM identified 3 files worth highlighting for reuse:
Provides cache_key generation and cache_set/cache_get functions that implement a stale-read tolerant caching pattern: if a cache miss occurs, the old value is returned (if available) while the new value is recomputed asynchronously. This prevents thundering herds and keeps the site responsive under high load. The functions are self-contained, depend only on Django's cache framework, and can be extracted into any Django project.
Contains send_mail_template and send_mail functions that render Django email templates (HTML and plain text) and send multipart emails with correct encoding. Handles subject template, context, bcc, attachments, and address splitting. A clean, reusable utility for any Django project needing template-driven email sending.
Implements rich text filtering using bleach with configurable allowed tags, attributes, and styles. The filter_level setting controls strictness (high/low/none). This is a well-structured, security-conscious HTML sanitizer that can be reused in any Django application requiring user-submitted HTML to be cleaned.