Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (29 sloc) 1.356 kb
# -*- coding: utf-8 -*-
from cms.exceptions import CMSDeprecationWarning
from django.conf import settings
from patch import post_patch, post_patch_check, pre_patch
import warnings
def patch_settings():
"""Merge settings with global cms settings, so all required attributes
will exist. Never override, just append non existing settings.
Also check for setting inconsistencies if settings.DEBUG
if patch_settings.ALREADY_PATCHED:
patch_settings.ALREADY_PATCHED = True
if getattr(settings, 'CMS_FLAT_URLS', False):
warnings.warn("CMS_FLAT_URLS are deprecated and will be removed in django CMS 2.4!", CMSDeprecationWarning)
if getattr(settings, 'CMS_MODERATOR', False):
warnings.warn("CMS_MODERATOR will be removed and replaced in django CMS 2.4!", CMSDeprecationWarning)
from cms.conf import global_settings
# patch settings
# merge with global cms settings
for attr in dir(global_settings):
if attr == attr.upper() and not hasattr(settings, attr):
setattr(settings._wrapped, attr, getattr(global_settings, attr))
if settings.DEBUG:
# check if settings are correct, call this only if debugging is enabled
patch_settings.ALREADY_PATCHED = False
Jump to Line
Something went wrong with that request. Please try again.