You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
👀 **Preview support** – Access draft content using `djangocms-versioning` supporting
24
-
permissions for authenticated staff user<br>
25
-
🧬 **Typed API schema** – Auto-generate OpenAPI schemas for pages and plugins with
26
-
`drf-spectacular`
26
+
## Requirements
27
+
28
+
- Python >= 3.10, < 3.14
29
+
- Django >= 4.2, < 6.1
30
+
- Django CMS >= 4.1, < 5.1
31
+
32
+
## Installation
33
+
34
+
Install using pip:
35
+
36
+
```bash
37
+
pip install djangocms-rest
38
+
```
39
+
40
+
Update your `INSTALLED_APPS` setting:
41
+
42
+
```python
43
+
INSTALLED_APPS= [
44
+
...
45
+
"djangocms_rest",
46
+
...
47
+
]
48
+
```
49
+
50
+
> `rest_framework` is installed as a dependency. Add it to `INSTALLED_APPS` if you want to use the browsable API UI or create additional DRF endpoints beyond djangocms-rest.
51
+
52
+
Add the API endpoints to your project's `urls.py`:
53
+
54
+
```python
55
+
from django.urls import path, include
56
+
57
+
urlpatterns = [
58
+
...
59
+
path('api/', include('djangocms_rest.urls')),
60
+
...
61
+
]
62
+
```
63
+
> Using `api/cms/` as the path helps separate djangocms-rest endpoints in API documentation and frontend implementation.
64
+
65
+
66
+
### Usage
27
67
28
-
🧩 **Flexible responses** – Fetch plugin content as JSON or fully rendered HTML
68
+
Make sure you have existing pages. If `rest_framework` is in `INSTALLED_APPS`, you can navigate to Django REST Framework's browsable API at `http://localhost:8000/api/`.
29
69
30
-
> ⚠️ **Note**
31
-
>
32
-
> `djangocms-rest` is under active development. Since the API is read-only, it's safe to explore
33
-
> without risk of unintended data changes.
70
+
## Documentation
34
71
35
-
## What is headless mode?
72
+
-**Getting Started** – Quick start guide and installation instructions
73
+
-**OpenAPI Support** – Schema generation and API documentation setup
74
+
-**How-to Guides** – Multi-site configuration, plugin creation, and serialization
|`/api/plugins/`| Fetch types forall installed plugins. Used for automatic type checks with frontend frameworks. |
307
-
|`/api/{language}/pages/`| Fetch the root page for a given language. |
308
-
|`/api/{language}/pages-tree/`| Fetch the complete page tree of all published documents for a given language. Suitable for smaller projects for automatic navigation generation. For large page sets, use the `pages-list` endpoint instead. |
309
-
|`/api/{language}/pages-list/`| Fetch a paginated list. Supports `limit`and`offset` parameters for frontend structure building. |
310
-
|`/api/{language}/pages/{path}/`| Fetch page details by path for a given language. Path and language information is available via `pages-list`and`pages-tree` endpoints. |
311
-
|`/api/{language}/placeholders/`<br/>`{content_type_id}/{object_id}/{slot}/`| Fetch published page content objects for a given language. Parameters available from page detail. |
209
+
| Endpoints | Description |
210
+
|:----------|:------------|
211
+
|`/api/languages/`| Fetch available languages for the site |
212
+
|`/api/plugins/`| Fetch plugin type definitions for frontend type checks |
213
+
|`/api/{language}/pages/`| Fetch the root page for a given language |
214
+
|`/api/{language}/pages-tree/`| Fetch complete page tree (suitable for smaller projects) |
215
+
|`/api/{language}/pages-list/`| Fetch paginated page list with `limit` and `offset` support |
216
+
|`/api/{language}/pages/{path}/`| Fetch page details by path |
217
+
|`/api/{language}/page_search/`| Search pages by query term |
218
+
|`/api/{language}/placeholders/{content_type_id}/{object_id}/{slot}/`| Fetch placeholder content (supports `?html=1` for rendered HTML) |
219
+
|`/api/{language}/menu/...`| Fetch menu navigation (supports optional `{from_level}/{to_level}/{extra_inactive}/{extra_active}`, `{root_id}`, and `{path}` parameters) |
> For complete endpoint documentation, request/response schemas, and authentication details, see the [API Reference](https://djangocms-rest.readthedocs.io/en/latest/reference/index.html).
312
225
313
226
### Private API (Preview)
314
227
@@ -375,23 +288,7 @@ Just add the `?preview` GET parameter to the above page, page-tree, or page-list
0 commit comments