Warning
Upgrading from previous versions
3.0 introduces some changes that require action if you are upgrading from a previous version.
django CMS 3.0 introduces a new frontend editing system as well as a customizable Django admin skin (djangocms_admin_style).
In the new system, Placeholders and their plugins are no longer managed in the admin site, but only from the frontend.
In addition, the system now offer two editing views:
Page titles can also be modified directly from the frontend.
The toolbar’s code has been simplified and its appearance refreshed. The toolbar is now a more consistent management tool for adding and changing objects. See Extending the Toolbar.
Warning
Upgrading from previous versions
3.0 now requires the django.contrib.messages application for the toolbar to work. See Enable messages for how to enable it.
We’ve added experimental support for Python 3.3. Support for Python 2.5 has been dropped.
Improvements in the django CMS environment for managing a multi-lingual site include:
The setting has been removed, along with the SEO fieldset in admin.
It’s now possible to specify fallback languages for a placeholder if the placeholder is empty for the current language. This must be activated in CMS_PLACEHOLDER_CONF per placeholder. It defaults to False to maintain pre-3.0 behavior.
The language_chooser template tag now only displays languages that are public. Use the toolbar language chooser to change the language to non-public languages.
If you have django-reversion installed you now have undo and redo options available directly in the toolbar. These can now revert plugin content as well as page content.
We have removed plugins from the core. This is not because you are not expected to use them, but because django CMS should not impose unnecessary choices about what to install upon its adopters.
The most significant of these removals is cms.plugins.text.
We provide djangocms-text-ckeditor, a CKEditor-based Text Plugin. It’s available from https://github.com/divio/djangocms-text-ckeditor. You may of course use your preferred editor; others are available.
Furthermore, we removed the following plugins from the core and moved them into seperate repositories.
Note
In order to update from the old cms.plugins.X to the new djangocms_X plugins, simply install the new plugin, remove the old cms.plugins.X from settings.INSTALLED_APPS and add the new one to it. Then run the migrations (python manage.py migrate djangocms_X).
We removed the file plugin (cms.plugins.file). Its new location is at:
As an alternative, you could also use the following (yet you will not be able to keep your existing files from the old cms.plugins.file!)
We removed the flash plugin (cms.plugins.flash). Its new location is at:
We removed the googlemap plugin (cms.plugins.googlemap). Its new location is at:
We removed the inherit plugin (cms.plugins.inherit). Its new location is at:
We removed the picture plugin (cms.plugins.picture). Its new location is at:
We removed the video plugin (cms.plugins.video). Its new location is at:
We removed the link plugin (cms.plugins.link). Its new location is at:
We removed the snippet plugin (cms.plugins.snippet). Its new location is at:
As an alternative, you could also use the following (yet you will not be able to keep your existing files from the old cms.plugins.snippet!)
Twitter disabled V1 of their API, thus we’ve removed the twitter plugin (cms.plugins.twitter) completely.
For alternatives have a look at these plugins:
Plugin Context Processors have had an argument added so that the rest of the context is available to them. If you have existing plugin context processors you will need to change their function signature to add the extra argument.
Apphooks have moved from the title to the page model. This means you can no longer have separate apphooks for each language. A new namespace field has been added.
Note
The reverse id is not used for the namespace anymore. If you used namespaced apphooks before, be sure to update your pages and fill out the namespace fields.
If you use apphook apps with app_name for app namespaces, be sure to fill out the namespace field as it’s now required to have a namespace defined if you use app namespaces.
request.current_app has been removed. If you relied on this, use the following code instead in your views:
def my_view(request):
current_app = resolve(request.path).namespace
context = RequestContext(request, current_app=current_app)
return render_to_response("my_templace.html", context_instance=context)
Details can be found in Attaching an Application multiple times.
PlaceholderAdmin doesn’t have language tabs anymore and the plugin editor is gone. The plugin API has changed and is now more consistent. PageAdmin uses the same API as PlaceholderAdmin now. If your app talked with the Plugin API directly be sure to read the code and the changed parameters. If you use PlaceholderFields you still need the PlaceholderAdmin as it delivers the API for editing the plugins and the placeholders.
The workflow in the future should look like this:
In addition to model level permissions, Placeholder now checks if a user has permissions on a specific object of that model. Details can be found here in Permissions.
In CMS_PLACEHOLDER_CONF, for each placeholder configuration, you can specify via ‘default_plugins’ a list of plugins to automagically add to the placeholder if empty. See default_plugins in CMS_PLACEHOLDER_CONF.
It’s now possible to configure module and plugins labels to show in the toolbar UI. See CMS_PLACEHOLDER_CONF for details.
Added a management command to copy content (titles and plugins) from one language to another.
The command can be run with:
manage.py cms copy_lang from_lang to_lang
Please read cms copy-lang before using.
Frontend editor is available for any Django model; see documentation for details.
All template tags are now in the cms_tags namespace so to use any cms template tags you can just do:
{% load cms_tags %}
A plugin’s translatable content can now be read and set through get_translatable_content() and set_translatable_content(). See Custom Plugins for more info.
Since django CMS 2.0 plugins had their table names start with cmsplugin_. We removed this behavior in 3.0 and will display a deprecation warning with the old and new table name. If your plugin uses south for migrations create a new empty schemamigration and rename the table by hand.
Pages are now cached by default. You can disable this behavior with CMS_PAGE_CACHE
Plugins have a new default property: cache=True. If all plugins in a placeholder have set this to True the whole placeholder will be cached if the toolbar is not in edit mode.
Warning
If your plugin is dynamic and processes current user or request data be sure to set cache=False
Plugins have a new attribute: cache=True. Its default value can be configured with CMS_PLUGIN_CACHE.
An advanced option has been added which controls, on a per-page basis, the X-Frame-Options header. The default setting is to inherit from the parent page. If no ancestor specifies a value, no header will be set, allowing Django’s own middleware to handle it (if enabled).
A new CMS_TEMPLATE variable is now available in the context: it contains the path to the current page template. See CMS_TEMPLATE reference for details.
placeholder_tags is now deprecated, the render_placeholder template tag can now be loaded from the cms_tags template tag library.
Using placeholder_tags will cause a DeprecationWarning to occur.
placeholder_tags will be removed in version 3.1.
cms.context_processors.media is now deprecated, please use cms.context_processors.cms_settings by updating TEMPLATE_CONTEXT_PROCESSORS in the settings
Using cms.context_processors.media will cause a DeprecationWarning to occur.
cms.context_processors.media will be removed in version 3.1.