Skip to content
Permalink
Browse files

Adding support for Django 2.2 LTS (#6655)

* New changes for cms 3.7

* Fix typo

* Fixed issue with force_color

* Removed unused import

* Added docs to index.rst

* Fixed travis jobs

* Fixed force_color command

* Changes after review

* Fixed django version in setup

* Update django-2.2.txt
  • Loading branch information...
vThaian authored and FinalAngel committed Jun 6, 2019
1 parent 15267a5 commit b810dd4417c78a9ac156049e622f0978e2b6517c
@@ -83,6 +83,24 @@ matrix:
env: DJANGO=2.1 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.6
env: TEST_DOCS=1 DJANGO=2.1 DATABASE_URL='sqlite://localhost/:memory:'

# DJANGO 2.2
- python: 3.5
env: DJANGO=2.2 DATABASE_URL='sqlite://localhost/:memory:'
dist: xenial
sudo: true
- python: 3.5
env: DJANGO=2.2 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.6
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.6
env: TEST_DOCS=1 DJANGO=2.2 DATABASE_URL='sqlite://localhost/:memory:'
dist: xenial
sudo: true
allow_failures:
- python: 2.7
env: DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
@@ -1,3 +1,8 @@
=== 3.7.0 (unreleased) ===

* Introduced Django 2.2 support.


=== 3.6.0 (2019-01-29) ===

* Removed the ``cms moderator`` command.
@@ -5,9 +5,9 @@
from collections import OrderedDict

from django.core.management.base import BaseCommand, CommandParser
from django.core.management.color import no_style
from django.core.management.color import no_style, color_style

from cms.utils.compat import DJANGO_2_0
from cms.utils.compat import DJANGO_2_0, DJANGO_2_2


def add_builtin_arguments(parser):
@@ -37,6 +37,9 @@ def add_builtin_arguments(parser):
help='Raise on CommandError exceptions')
parser.add_argument('--no-color', action='store_true', dest='no_color', default=False,
help="Don't colorize the command output.")
if DJANGO_2_2:
parser.add_argument('--force-color', action='store_true', dest='force_color', default=False,
help="Colorize the command output.")


class SubcommandsCommand(BaseCommand):
@@ -85,6 +88,8 @@ def handle(self, *args, **options):
if options.get('no_color'):
command.style = no_style()
command.stderr.style_func = None
if DJANGO_2_2 and options.get('force_color'):
command.style = color_style(force_color=True)
if options.get('stdout'):
command.stdout._out = options.get('stdout')
if options.get('stderr'):
@@ -26,6 +26,7 @@ def __enter__(self):
def __exit__(self, type, value, traceback):
setattr(sys, 'std%s' % self.std, getattr(sys, '__std%s__' % self.std))


class StdoutOverride(StdOverride):
"""
This overrides Python's the standard output and redirects it to a StringIO
@@ -39,7 +39,7 @@ def test_command_line_publishes_zero_pages_on_empty_db(self):
with StdoutOverride() as buffer:
# Now we don't expect it to raise, but we need to redirect IO
call_command('cms', 'publisher-publish')
lines = buffer.getvalue().split('\n') #NB: readlines() doesn't work
lines = buffer.getvalue().split('\n') # NB: readlines() doesn't work

for line in lines:
if 'Total' in line:
@@ -62,7 +62,7 @@ def test_command_line_ignores_draft_page(self):
with StdoutOverride() as buffer:
# Now we don't expect it to raise, but we need to redirect IO
call_command('cms', 'publisher-publish')
lines = buffer.getvalue().split('\n') #NB: readlines() doesn't work
lines = buffer.getvalue().split('\n') # NB: readlines() doesn't work

for line in lines:
if 'Total' in line:
@@ -87,7 +87,7 @@ def test_command_line_publishes_draft_page(self):
with StdoutOverride() as buffer:
# Now we don't expect it to raise, but we need to redirect IO
call_command('cms', 'publisher-publish', include_unpublished=True)
lines = buffer.getvalue().split('\n') #NB: readlines() doesn't work
lines = buffer.getvalue().split('\n') # NB: readlines() doesn't work

for line in lines:
if 'Total' in line:
@@ -118,7 +118,7 @@ def test_command_line_publishes_selected_language(self):
with StdoutOverride() as buffer:
# Now we don't expect it to raise, but we need to redirect IO
call_command('cms', 'publisher-publish', language='de')
lines = buffer.getvalue().split('\n') #NB: readlines() doesn't work
lines = buffer.getvalue().split('\n') # NB: readlines() doesn't work

for line in lines:
if 'Total' in line:
@@ -152,7 +152,7 @@ def test_command_line_publishes_selected_language_drafts(self):
with StdoutOverride() as buffer:
# Now we don't expect it to raise, but we need to redirect IO
call_command('cms', 'publisher-publish', language='de', include_unpublished=True)
lines = buffer.getvalue().split('\n') #NB: readlines() doesn't work
lines = buffer.getvalue().split('\n') # NB: readlines() doesn't work

for line in lines:
if 'Total' in line:
@@ -221,7 +221,7 @@ def test_command_line_publishes_one_page(self):
with StdoutOverride() as buffer:
# Now we don't expect it to raise, but we need to redirect IO
call_command('cms', 'publisher-publish')
lines = buffer.getvalue().split('\n') #NB: readlines() doesn't work
lines = buffer.getvalue().split('\n') # NB: readlines() doesn't work

for line in lines:
if 'Total' in line:
@@ -279,7 +279,7 @@ def test_command_line_publish_one_site(self):
with StdoutOverride() as buffer:
# Now we don't expect it to raise, but we need to redirect IO
call_command('cms', 'publisher-publish', site=siteB.id)
lines = buffer.getvalue().split('\n') #NB: readlines() doesn't work
lines = buffer.getvalue().split('\n') # NB: readlines() doesn't work

for line in lines:
if 'Total' in line:
@@ -310,7 +310,7 @@ def test_command_line_publish_multiple_languages_check_count(self):
with StdoutOverride() as buffer:
# Now we don't expect it to raise, but we need to redirect IO
call_command('cms', 'publisher-publish')
lines = buffer.getvalue().split('\n') #NB: readlines() doesn't work
lines = buffer.getvalue().split('\n') # NB: readlines() doesn't work

for line in lines:
if 'Total' in line:
@@ -14,3 +14,4 @@
DJANGO_1_11 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.0')
DJANGO_2_0 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.1')
DJANGO_2_1 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.2')
DJANGO_2_2 = LooseVersion(DJANGO_VERSION) < LooseVersion('3.0')
@@ -0,0 +1,84 @@
.. _upgrade-to-3.7.0:

###################
3.7.0 release notes
###################

This release of django CMS concentrates on introducing support for Django 2.2 LTS.


*******************
What's new in 3.7.0
*******************

Improvements and new features
=============================

* introduced support for Django 2.2


*********************
How to upgrade to 3.7
*********************

We assume you are upgrading from django CMS 3.6.

Please make sure that your current database is consistent and in a healthy
state, and **make a copy of the database before proceeding further.**

Then run::

python manage.py migrate # to ensure that your database is up-to-date with migrations
python manage.py cms fix-tree

Check custom code and third-party applications for use of deprecated or removed functionality or
APIs (see above). Some third-party components may need to be updated.

Install the new version of django CMS from GitHub or via pip.

Run::

python manage.py migrate

to apply the new migrations.


***********************************
Create a new django CMS 3.7 project
***********************************

On the Divio Cloud
==================

The Divio Cloud offers an easy way to set up django CMS projects. In the `Divio Cloud Control Panel
<https://control.divio.com>`_, create a new django CMS project and **Deploy** it.


Using the django CMS Installer
==============================

.. note::

The django CMS Installer is not yet available for django CMS 3.6 or Django 2 or later.

This section will be updated or removed before the final release of django CMS 3.6.


****************************
Contributors to this release
****************************

* Daniele Procida
* Vadim Sikora
* Paulo Alvarado
* Bartosz Płóciennik
* Katie McLaughlin
* Krzysztof Socha
* Mateusz Kamycki
* Sergey Fedoseev
* Aliaksei Urbanski
* heppstux
* Chematronix
* Frank
* Jacob Rief
* Julz
@@ -13,6 +13,7 @@ makes changes to your database.
.. toctree::
:maxdepth: 1

3.7
3.6
3.5.3
3.5.2
@@ -18,14 +18,16 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
]

INSTALL_REQUIREMENTS = [
'Django>=1.11,<2.2',
'Django>=1.11,<3.0',
'django-classy-tags>=0.7.2',
'django-formtools>=2.1',
'django-treebeard>=4.3',
@@ -0,0 +1,2 @@
-r requirements_base.txt
Django>=2.2,<3.0

0 comments on commit b810dd4

Please sign in to comment.
You can’t perform that action at this time.