Search code examples
pluginscontent-management-systembackenddjango-cms

How to create django-cms page executing a command from a cms_plugin?


The idea is that from a plugin you have to give name and link, then the plugin will create a new page with title as name, set is published = true, select a default template and leave the other fields blank.

The closest info I found is in https://gist.github.com/894776 but i don't get this line

from gamesradar.apps.cms_override.api import create_page, add_plugin Where did that came from?

Also if there is an easiest way to do this is welcome. Thanks


Solution

  • Since django CMS 2.2 there is a Python API to create CMS objects (Pages, Titles, Plugins).

    Please refer to http://docs.django-cms.org/en/2.3/extending_cms/api_references.html#cms-api for docs.