TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/rahul-baberwal/django-var-cms/llms.txt
Use this file to discover all available pages before exploring further.
django-var-cms source repository includes a fully working demo Django app that showcases every major feature: role-based permissions, Quill rich-text editing, image/media handling, regex validators, custom object actions, and branding configuration. It is the fastest way to see everything in action before wiring up your own project.
Setup
The
seed_demo management command creates groups, test user accounts, sample categories, articles, pages, and media asset records in one step:Navigate to http://127.0.0.1:8000/var-cms/ and log in with any of the demo accounts below.
Demo user accounts
Theseed_demo command creates five ready-to-use accounts covering every permission tier:
| Username | Password | Role | Permissions |
|---|---|---|---|
| admin | admin | superuser | Full unrestricted access |
| editor | editor | editor | Add + Edit (no delete) |
| author | author | author | Add + Edit limited fields (no delete) |
| viewer | viewer | viewer | List + View records only |
| alice | alice | viewer | Viewer group + per-user delete override |
alice is a member of the viewer group but has a UserPermission override
applied directly on the Article model that grants her add, edit, and delete
rights. This demonstrates how UserPermission can extend or override group
permissions on a per-user, per-model basis.Demo models
The demo app registers four models that together exercise the full feature surface of django-var-cms.Category
Simple taxonomy model for grouping articles.| Field | Type | Notes |
|---|---|---|
name | CharField | Display name |
slug | SlugField | Unique; regex-validated (^[a-z0-9-]+$) |
description | TextField | Optional |
is_active | BooleanField | Toggled via a custom object action |
created_at | DateTimeField | Auto-set on creation |
Article
The primary content model. Demonstrates Quill editor, FK relationships, and multi-role editable field restrictions.| Field | Type | Notes |
|---|---|---|
title | CharField | Max 255 chars |
slug | SlugField | Unique |
category | ForeignKey → Category | Nullable |
author | CharField | Plain text author name |
body | TextField | Rendered with Quill.js (html_fields = ["body"]) |
status | CharField (choices) | draft / published / archived |
is_featured | BooleanField | — |
view_count | PositiveIntegerField | Read-only |
rating | DecimalField | Nullable, 1 decimal place |
created_at | DateTimeField | Auto-set on creation |
updated_at | DateTimeField | Auto-updated on save |
MediaAsset
DemonstratesImageField, FileField, modal-based previews, and the built-in image cropper.
| Field | Type | Notes |
|---|---|---|
title | CharField | Max 200 chars |
asset_type | CharField (choices) | image / video / audio / document / other |
image | ImageField | Uploaded to var_cms/images/%Y/%m/ |
file | FileField | Uploaded to var_cms/files/%Y/%m/ |
alt_text | CharField | Optional accessibility label |
description | TextField | Optional |
tags | CharField | Comma-separated tag string |
created_at | DateTimeField | Auto-set on creation |
Page
Hierarchical CMS page model with self-referential parent FK and Quill body.| Field | Type | Notes |
|---|---|---|
title | CharField | Max 255 chars |
slug | SlugField | Unique |
meta_desc | CharField | Max 160 chars, for SEO |
body | TextField | Quill editor (html_fields = ["body"]) |
parent | ForeignKey → self | Nullable self-reference for page tree |
is_published | BooleanField | — |
show_in_nav | BooleanField | — |
sort_order | PositiveSmallIntegerField | Controls ordering |
created_at | DateTimeField | Auto-set on creation |
Complete var_cms_admin.py reference
The full registration file from the demo app is reproduced below. It is auto-discovered by var_cms at startup — no explicit import or INSTALLED_APPS entry is needed beyond adding "demo" to your app list.
demo/var_cms_admin.py
About seed_demo
python manage.py seed_demo is idempotent — re-running it will not
duplicate records. It uses get_or_create throughout, so it is safe to run
multiple times or after resetting individual tables. It seeds:- Groups:
editor,author,viewer - Users: the five accounts listed above (skipped if already present)
- Categories: Technology, Design, Business, Science
- Articles: 12 sample articles across all statuses and categories
- Pages: Home, About Us, Contact, Privacy Policy
- Media assets: 4 placeholder records (no actual files — upload via the CMS)