This project extends the functionality of the Django CMS framework by providing a way to import and export plugins from one page to another, across different projects, or even between different Django CMS installations. This is useful when your page exists in a development environment and you want to move it to a production environment, or when you have multiple CMS that uses the same content.
If you would like to contribute to this project, please read our CONTRIBUTING file for guidelines.
- Export / import plugins into / from a JSON file
- Add custom serializers / deserializers to export /import custom types used in your plugins
See the Python/Django/Django CMS for the current release version in the setup file or in our documentation.
- Install the package using pip:
pip install djangocms_plugie
- Add
djangocms_plugie
to yourINSTALLED_APPS
:
INSTALLED_APPS = [
...
'djangocms_plugie',
...
]
- Add the following to your
urls.py
:
urlpatterns = [
...
path('admin/', include('djangocms_plugie.urls')),
...
]
- Setup 'plugie' from your terminal with the following command:
plugie <project_dir>
This will create a 'plugie_config.json' file and a 'plugie/custom_methods' folder in your project directory, including some default methods.
- The 'plugie_config.py' file is where you can customize some functionalities of the app.
- The 'custom_methods' folder is where you can add custom methods that can be used in your custom serializers and deserializers. You also get a 'default.py' file with some default methods that you can use as a reference or that you might want to override.
You can find more information about this in the documentation.
-
Go to the Django CMS admin and select the page where you want to export the plugins.
-
Open the structure sidebar and click the hamburger icon on the right side of the placeholder or plugin tree that you want to export.
-
Click the 'Export plugins' option.
-
Check the downloaded JSON file to see the exported plugins.
-
Go to the page where you want to import the plugins.
-
Open the structure sidebar and click the hamburger icon on the right side of the placeholder or plugin tree where you want to import the plugins.
-
Click the 'Import plugins' option.
-
A modal will open where you can select the JSON file previously exported.
-
Click the 'Import' button.
-
The plugins will be imported to the selected placeholder or plugin tree.
The documentation is available here.
This project is licensed under the MIT License - see the LICENSE file for details.