Skip to content

Commit a7ceac2

Browse files
author
Mateusz Marzantowicz
committed
Check for cms.middleware.multilingual.MultilingualURLMiddleware
1 parent 2e857ae commit a7ceac2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cms/utils/setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ def validate_settings():
2424
if 'django.core.context_processors.request' not in settings.TEMPLATE_CONTEXT_PROCESSORS:
2525
raise ImproperlyConfigured('django CMS requires django.core.context_processors.request in settings.TEMPLATE_CONTEXT_PROCESSORS to work correctly.')
2626

27+
multilingual_middleware = 'cms.middleware.multilingual.MultilingualURLMiddleware'
28+
locale_middleware = 'django.middleware.locale.LocaleMiddleware'
29+
30+
if multilingual_middleware in settings.MIDDLEWARE_CLASSES and locale_middleware in settings.MIDDLEWARE_CLASSES:
31+
raise ImproperlyConfigured('django CMS MultilingualURLMiddleware replaces django.middleware.locale.LocaleMiddleware! Please remove django.middleware.locale.LocaleMiddleware from your MIDDLEWARE_CLASSES settings.')
32+
2733

2834
def setup():
2935
"""

0 commit comments

Comments
 (0)