Settings¶
djangocms-rest is configured almost entirely through django CMS, Django and third-party settings. It defines one setting of its own; the rest of this page lists the existing settings that change how the API behaves, with pointers to the guides that use them.
Settings defined by djangocms-rest¶
REST_JSON_RENDERING¶
- Type:
bool- Default:
not CMS_TEMPLATES— i.e.Truewhen no classicCMS_TEMPLATESare configured (a headless install),Falseotherwise.
Controls whether django CMS renders content as JSON in the editing UI (the toolbar /
structure board), using the package’s RESTRenderer. When enabled, djangocms-rest also
disables djangocms-text’s inline editing (TEXT_INLINE_EDITING), since rich text is
delivered as data rather than edited in place.
Important
This setting affects only what editors see inside django CMS. It does not change the REST API responses — content endpoints always return serialized JSON regardless of its value.
Set it explicitly to override the default — for example, to keep JSON rendering on in a
project that still defines CMS_TEMPLATES:
# settings.py
REST_JSON_RENDERING = True
See Headless django CMS for the editing-and-preview model this fits into.
Django CMS settings that affect the API¶
These are standard django CMS settings; djangocms-rest reads them rather than defining them.
Setting |
Effect on djangocms-rest |
|---|---|
|
Drives the |
|
Its presence is the default basis for REST_JSON_RENDERING. |
|
Declares placeholder slots and constraints; reflected by the
placeholder endpoint ( |
|
The |
Django settings that affect the API¶
Setting |
Effect on djangocms-rest |
|---|---|
|
Standard Django i18n, configured alongside |
|
The fallback site when no |
|
The Django cache backend used to store serialized placeholder content (Caching and performance). |
|
Required for cross-origin, session-authenticated preview requests. See Access draft (preview) content. |
Third-party settings¶
Setting |
Effect on djangocms-rest |
|---|---|
|
From django-cors-headers;
needed for browser frontends and for the |
|
Django REST framework configuration. Set |
|
drf-spectacular schema/documentation options (optional). |
|
From |
Middleware¶
djangocms_rest.middleware.SiteContextMiddleware is not a setting but is added to
MIDDLEWARE to resolve the X-Site-ID request header for single-instance multi-site
deployments. See Serve multiple sites from one instance.