Adding django-var-cms to an existing Django project takes only a few minutes. The library ships as a standard Django app — install the package, register it inDocumentation 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.
INSTALLED_APPS, wire up the URLs, and run migrations. No database schema changes are needed beyond Django’s own auth tables.
Install the package
Install
django-var-cms together with its required dependencies. Pillow is needed for image processing and WhiteNoise for serving static files in production.Configure settings.py
Add You can also customise the CMS branding directly in
"var_cms" to INSTALLED_APPS and set the required static/media and authentication settings:settings.py
LOGIN_URL and LOGIN_REDIRECT_URL are standard Django settings. Setting them to the CMS paths ensures that @login_required decorators used internally redirect unauthenticated users to the glassmorphic CMS login page rather than Django’s default /accounts/login/.settings.py using the VAR_CMS_* prefix:settings.py
Add URL routing
Include
var_cms.urls in your project’s root urls.py. Use namespace="var_cms" — this is required for the internal reverse() calls to resolve correctly.urls.py
The
static(...) helper only serves files in development (DEBUG=True). In production, configure your web server (nginx, Caddy, etc.) or a cloud storage backend to serve the MEDIA_ROOT directory instead.Run migrations
django-var-cms does not add any custom database tables of its own, but it depends on Django’s built-in Then start the development server and navigate to the dashboard:Open http://127.0.0.1:8000/var-cms/ and log in with a Django superuser account. If you don’t have one yet, create it first:
auth and sessions apps. Run migrations to make sure all tables are in place:Optional Dependencies
django-var-cms ships three optional extras declared inpyproject.toml. Install any combination of them depending on your project’s needs:
| Extra | Installs | When to use |
|---|---|---|
[tailwind] | django-tailwind-cli >= 2.0 | Compile Tailwind CSS utility styles for custom frontend templates. Run python manage.py tailwind build (production) or python manage.py tailwind start (dev with hot reload). |
[geo] | django[gis] >= 5.0 | Register models that contain GeoDjango spatial fields (PointField, PolygonField, etc.). Requires PostGIS or SpatiaLite. |
[pdf] | pdf2image >= 1.16 | Enable PDF thumbnail generation in the media conversion API. Requires poppler-utils to be installed at the OS level. |
Static Files in Production
django-var-cms bundles its own CSS, JavaScript, and icon assets. In production, runcollectstatic and serve the STATIC_ROOT directory through WhiteNoise or your web server:
MIDDLEWARE immediately after SecurityMiddleware:
settings.py