Skip to content

Instantly share code, notes, and snippets.

wfehr / README
Last active Jun 27, 2019
Overview of changed pages for django-cms
This gist provides an overview for page-changes in django-cms.
It prints out the changed plugins etc. for pages.
Note: This is not a 'diff-tool', so you won't see the exact changes, e.g. text-content.
wfehr /
Created Oct 17, 2018
Test-app for django-cms apphooks.
wfehr /
Last active Oct 30, 2018
Django middleware to remove trailing slashes
from django import http
from django.conf import settings
from django.core import urlresolvers
from django.core.exceptions import ImproperlyConfigured
from django.utils.deprecation import MiddlewareMixin
class AppendOrRemoveSlashMiddleware(MiddlewareMixin):
This middleware removes a given trailing slash if the resulting path is
wfehr /
Last active Oct 16, 2018
Helper for migrations in django-cms for plugins which get a model and previously had none.
def create_plugins_from_cmsplugin(new_model_app, new_plugin_model_name,
new_plugin_name, apps=None):
Create plugins for `new_plugin_name` from CMSPlugin-Plugins. This is
necessary if you add a model to a plugin which previously had none.
if apps is None:
from django.apps.registry import apps as dj_apps
apps = dj_apps
wfehr /
Created Apr 30, 2018
Migration to move deprecated cmsplugin-*-plugins to the newer djangocms-*-plugins
from django.apps import apps as global_apps
from django.db import migrations
from djangocms_file.models import get_templates as get_file_templates
from djangocms_picture.models import get_templates as get_picture_templates
def forwards_filer_file(apps, schema_editor):
CMSPluginFilerFile = apps.get_model('cmsplugin_filer_file',