{% extends "var_cms/base.html" %} {% load var_cms_tags %} {% block title %}Dashboard{% endblock %} {% block content %}

Control Center

Welcome back, {{ request.user }}. Manage your models, edit content with rich HTML, crop assets, and translate metadata directly.

{% if request.user.groups.all %}
Roles: {% for g in request.user.groups.all %} {{ g.name }} {% endfor %}
{% endif %}
{% for item in registry %} {% if item.dashboard_card %}
{{ item.app|upper }} {% if item.admin.icon %} {% else %} {{ item.verbose_name_plural|slice:":1"|upper }} {% endif %}
{{ item.count }}
{{ item.verbose_name_plural|title }}
{% if item.buttons %}
{% for btn in item.buttons %} {{ btn.label }} {% endfor %}
{% endif %}
{% endif %} {% empty %}
No models registered. Create var_cms_admin.py in any app.
{% endfor %}

Live Color Customizer

Pick a primary accent brand color using the picker below to dynamically generate HSL values and see a live preview.

Brand Color
#7A5CFF
Generated Settings Variable var_cms_site.accent_color = "250, 100%, 68%"

Integration Guide

Integrate VAR CMS into your Django application and customize its branding options within your admin registrations.

# myapp/var_cms_admin.py
from var_cms.registry import var_cms_site, VarCMSModelAdmin
from .models import Article

# 1. Custom Branding Settings
var_cms_site.site_header = "My Site Header"
var_cms_site.site_sub    = "Control Dashboard"
var_cms_site.site_url    = "/"
var_cms_site.logo_url    = "/static/logo.png"

# 2. Custom Color Palette (Paste generated code)
var_cms_site.accent_color = "250, 100%, 68%"

# 3. Custom Model Configurations
class ArticleAdmin(VarCMSModelAdmin):
    icon = "file-text"
    html_fields = ["body"]
    # Custom regular expression validation (applies client-side pattern + server-side RegexValidator)
    regex_validators = {
        "slug": (r"^[a-z0-9-]+$", "Slug must consist of lowercase letters, numbers, and hyphens only.")
    }
    card_buttons = [
        {"label": "All Articles", "action": "list"},
        {"label": "Write Draft", "action": "add"}
    ]

var_cms_site.register(Article, ArticleAdmin)
{% endblock %}