Components
Reusable classes, utilities, and infrastructure provided by the prefab package. All components can be imported directly and used independently in any Django project.
Core
| Component | Module | Description |
|---|---|---|
| Models | prefab.models | Abstract model mixins for timestamps, slugs, ordering, UUIDs, hierarchy |
| Views | prefab.views | CRUD base views, login, breadcrumbs, JSON, event tracking |
| Managers | prefab.managers | Smart PostgreSQL count, composable filter managers |
| Helpers | prefab.helpers | Utility functions for settings, IPs, slugs, lists, HTML |
| Middleware | prefab.middleware | Whitespace stripping, lowercase redirects |
Templates
| Component | Module | Description |
|---|---|---|
| Templates | prefab/templates/ | base.html with full block structure and Open Graph |
| Snippets | prefab/templates/snippets/ | Breadcrumbs, menus, forms, pagination, modals |
| Template Tags | prefab.templatetags | Markdown, HTML, form field checks, MediaWiki |
| Context Processors | prefab.context_processors | Site identity and GA event tracking in templates |
Templates
| Component | Module | Description |
|---|---|---|
| Templates | prefab/templates/ | base.html with full block structure and Open Graph |
| Snippets | prefab/templates/snippets/ | Breadcrumbs, menus, forms, pagination, modals |
| Template Tags | prefab.templatetags | Markdown, HTML, form field checks, MediaWiki |
| Context Processors | prefab.context_processors | Site identity and GA event tracking in templates |
Forms
| Component | Module | Description |
|---|---|---|
| Forms | prefab.forms | Crispy-forms base, nested model forms |
| Inlines | prefab.inlines | Inline formsets for use with create/update views |
| Widgets | prefab.widgets | Image upload with preview |
| Wizard | prefab.wizard | Multi-step forms with database-backed storage |
Infrastructure
| Component | Module | Description |
|---|---|---|
| Admin | prefab.admin | PrefabAdmin base class, smart paginator, content type admin |
| Admin2 | prefab.admin2 | Custom staff dashboard with reports, search, and toolbar |
| Tasks | prefab.tasks | Celery app setup and periodic task base class |
| Paginators | prefab.paginators | Soft-limit and Digg-style paginators |
| Sitemaps | prefab.sitemaps | Base sitemap with lastmod from model timestamps |
| Storages | prefab.storages | S3 and Google Cloud Storage backends |
| URLs | prefab.urls | Default URL configuration |