Each django CMS page is based on a template. You can set the page's template from the django CMS toolbar (Page > Templates) or in its  Advanced settings.

You may want to add new Django templates to your projects. For example, you might decide that some pages should use a template that has a sidebar, or a different header.

Each template is just an HTML file that also contains some Django template tags. To make a template available to django CMS, it needs to be listed in the project's settings, along with a human-readable name.

Specify your django CMS project's template files

Via the Divio Cloud Control Panel

  • Go to your project's Dashboard in the Divio Cloud Control Panel.
  • Select Addons. 
  • Select Aldryn django CMS from the list of installed addons. 
  • Hit Configure

Amongst the available settings for this addon you'll see one for CMS Templates. The field takes a JSON list of templates, such as: 

[["home.html", "Home"], ["special.html", "Special"]]

in which the first value is the actual template name, and the second is the human-readable name that will appear in the django CMS admin.

Save your changes and redeploy the project.

Locally, via the project's settings.py

Templates can also be supplied in a project's settings.py , using the CMS_TEMPLATE  setting. When provided in this way, the settings will override any template settings entered in the Control Panel.

See the django CMS documentation for details of this setting.

  • Change the setting locally.
  • Save and test your settings.
  • Push your changes to the Divio Cloud, either by using Upload in the Divio app, or by using Git in the shell.

Redeploy your project.

Location of template files

Your template files for use with the CMS should be placed in the project's templates directory.

Did this answer your question?