Quick Start¶
Get up and running with djangocms-rest in minutes.
Prerequisites¶
Note
A running Django CMS project is required. Follow the Installing Django CMS by hand guide to get started.
Installation¶
# Install djangocms-rest
poetry add djangocms-rest
Configuration¶
# Add to INSTALLED_APPS in your project's settings.py
INSTALLED_APPS = [
# ... other apps
'djangocms_rest',
]
# Include URLs in your project's urls.py
urlpatterns = [
# ... other URLs
path('api/', include('djangocms_rest.urls')),
]
Start Server¶
# Start the Django development server
python manage.py runserver 8080
Test API¶
Visit http://localhost:8080/api/languages/ to test the API endpoints.
# Test the API endpoints
curl -X 'GET' \
'http://localhost:8080/api/languages/' \
-H 'accept: application/json'
If you see a response like this, you’re good to go:
[
{
"code": "en",
"name": "English",
"public": true,
"fallbacks": [
"en"
],
"redirect_on_fallback": true,
"hide_untranslated": false
},
{
"code": "de",
"name": "Deutsch",
"public": false,
"fallbacks": [
"en"
],
"redirect_on_fallback": true,
"hide_untranslated": true
}
]
See the Languages Endpoints reference for more information.
Next Steps¶
Follow the Installation guide for advanced features like multi-site support, languages, and OpenAPI documentation
Explore the API Reference for detailed API documentation
Check out How-to Guides for implementation guides