Compare commits
10 commits
89b6463998
...
ab3df90923
Author | SHA1 | Date | |
---|---|---|---|
|
ab3df90923 | ||
|
7d2013f62b | ||
|
1999784b2f | ||
|
9d07f0c714 | ||
|
d177a83fa5 | ||
|
619a088d2c | ||
|
7be32d8c08 | ||
|
e970887206 | ||
|
7355c710a6 | ||
|
77ac20544a |
7 changed files with 55 additions and 15 deletions
|
@ -14,8 +14,11 @@ env:
|
|||
- TOXENV='pep8'
|
||||
- TOXENV='isort'
|
||||
- TOXENV='docs'
|
||||
- DJANGO='django110' CMS='cms34'
|
||||
- DJANGO='django19' CMS='cms34'
|
||||
- DJANGO='django19' CMS='cms33'
|
||||
- DJANGO='django19' CMS='cms32'
|
||||
- DJANGO='django18' CMS='cms34'
|
||||
- DJANGO='django18' CMS='cms33'
|
||||
- DJANGO='django18' CMS='cms32'
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ Usage
|
|||
|
||||
#. Configure django-multisite as documented upstream
|
||||
|
||||
#. Use ``SITE_ID = SiteId(default=1)`` instead of the documented ``SITE_ID = SiteID()``
|
||||
#. Use ``SITE_ID = SiteID(default=1)`` instead of the documented ``SITE_ID = SiteID()``
|
||||
|
||||
|
||||
#. Add ``multisite``, ``djangocms_multisite`` to ``INSTALLED_APPS``::
|
||||
|
|
|
@ -14,7 +14,7 @@ HELPER_SETTINGS = dict(
|
|||
ROOT_URLCONF='tests.test_utils.urls1',
|
||||
INSTALLED_APPS=[
|
||||
'multisite',
|
||||
'djangocms_text_ckeditor'
|
||||
'djangocms_text_ckeditor',
|
||||
],
|
||||
LANGUAGE_CODE='en',
|
||||
LANGUAGES=(
|
||||
|
@ -56,9 +56,34 @@ HELPER_SETTINGS = dict(
|
|||
'www.example.com': ('alias1.example.com', 'alias2.example.com',),
|
||||
'www.example2.com': ('alias1.example2.com', 'alias2.example2.com',),
|
||||
},
|
||||
MULTISITE_CMS_FALLBACK='www.example.com'
|
||||
MULTISITE_CMS_FALLBACK='www.example.com',
|
||||
ALLOWED_HOSTS=['*'],
|
||||
)
|
||||
|
||||
try:
|
||||
import djangocms_blog
|
||||
HELPER_SETTINGS['INSTALLED_APPS'].extend([
|
||||
'filer',
|
||||
'easy_thumbnails',
|
||||
'aldryn_apphooks_config',
|
||||
'cmsplugin_filer_image',
|
||||
'parler',
|
||||
'taggit',
|
||||
'taggit_autosuggest',
|
||||
'meta',
|
||||
'djangocms_blog',
|
||||
])
|
||||
HELPER_SETTINGS['THUMBNAIL_PROCESSORS'] = (
|
||||
'easy_thumbnails.processors.colorspace',
|
||||
'easy_thumbnails.processors.autocrop',
|
||||
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
|
||||
'easy_thumbnails.processors.filters',
|
||||
)
|
||||
HELPER_SETTINGS['META_SITE_PROTOCOL'] = 'http'
|
||||
HELPER_SETTINGS['META_USE_SITES'] = True
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
def run():
|
||||
from djangocms_helper import runner
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
from cms.utils.apphook_reload import reload_urlconf
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import set_urlconf
|
||||
from django.utils.cache import patch_vary_headers
|
||||
|
@ -36,13 +37,17 @@ class CMSMultiSiteMiddleware(object):
|
|||
# about the request (e.g MyModel.get_absolute_url()) get the correct
|
||||
# urlconf.
|
||||
set_urlconf(urlconf)
|
||||
try:
|
||||
# In django CMS 3.4.2 this allows us to save a few queries thanks to per-site appresolvers caching
|
||||
reload_urlconf(clear_cache=False)
|
||||
except TypeError:
|
||||
reload_urlconf()
|
||||
except KeyError:
|
||||
# use default urlconf (settings.ROOT_URLCONF)
|
||||
set_urlconf(None)
|
||||
|
||||
def process_response(self, request, response):
|
||||
if getattr(request, 'urlconf', None):
|
||||
patch_vary_headers(response, ('Host',))
|
||||
patch_vary_headers(response, ('Host',))
|
||||
# set back to default urlconf
|
||||
set_urlconf(None)
|
||||
return response
|
||||
|
|
|
@ -20,6 +20,12 @@ urlpatterns = [
|
|||
url(r'^jsi18n/(?P<packages>\S+?)/$', javascript_catalog),
|
||||
]
|
||||
|
||||
try:
|
||||
import taggit_autosuggest
|
||||
urlpatterns.append(url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')))
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
|
||||
urlpatterns += i18n_patterns(
|
||||
|
|
|
@ -20,6 +20,12 @@ urlpatterns = [
|
|||
url(r'^jsi18n/(?P<packages>\S+?)/$', javascript_catalog),
|
||||
]
|
||||
|
||||
try:
|
||||
import taggit_autosuggest
|
||||
urlpatterns.append(url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')))
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
|
||||
urlpatterns += i18n_patterns(
|
||||
|
|
15
tox.ini
15
tox.ini
|
@ -1,26 +1,21 @@
|
|||
[tox]
|
||||
envlist = pep8,isort,docs,py{35,34,27}-django{19}-{cms33,cms32},py{35,34,33,27}-django{18}-cms{33,32,31},py{34,33,27}-django{17,16}-cms{32,31,30},py{26}-django16-cms{31,30}
|
||||
envlist = pep8,isort,docs,py{35,34,27}-django{110}-cms{34},py{35,34,27}-django{19}-cms{34,33,32},py{35,34,33,27}-django{18}-cms{34,33,32}
|
||||
|
||||
[testenv]
|
||||
commands = {env:COMMAND:python} cms_helper.py test djangocms_multisite
|
||||
deps =
|
||||
django16: Django>=1.6,<1.7
|
||||
django16: django-taggit<0.18
|
||||
django16: django-mptt<0.8
|
||||
django17: Django>=1.7,<1.8
|
||||
django17: django-mptt<0.8
|
||||
django18: Django>=1.8,<1.9
|
||||
django18: django-mptt>=0.8
|
||||
django19: Django>=1.9,<1.10
|
||||
django19: django-mptt>=0.8
|
||||
cms30: https://github.com/divio/django-cms/archive/release/3.0.x.zip
|
||||
cms30: djangocms-text-ckeditor<2.8
|
||||
cms31: https://github.com/divio/django-cms/archive/release/3.1.x.zip
|
||||
cms31: djangocms-text-ckeditor<2.9
|
||||
django110: Django>=1.10,<1.11
|
||||
django110: django-mptt>=0.8
|
||||
cms32: https://github.com/divio/django-cms/archive/release/3.2.x.zip
|
||||
cms32: djangocms-text-ckeditor<3.0
|
||||
cms33: https://github.com/divio/django-cms/archive/release/3.3.x.zip
|
||||
cms33: djangocms-text-ckeditor>=3.0
|
||||
cms34: https://github.com/divio/django-cms/archive/release/3.4.x.zip
|
||||
cms34: djangocms-text-ckeditor>=3.0
|
||||
https://github.com/nephila/djangocms-helper/archive/develop.zip
|
||||
-r{toxinidir}/requirements-test.txt
|
||||
|
||||
|
|
Loading…
Reference in a new issue