8000 Adding support for Django 2.2 LTS (#6655) (#6691) · django-cms/django-cms@c476bd2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c476bd2

Browse files
FinalAngeljonathan-s
authored andcommitted
Adding support for Django 2.2 LTS (#6655) (#6691)
* 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
1 parent d7b3f58 commit c476bd2

File tree

9 files changed

+134
-5
lines changed

9 files changed

+134
-5
lines changed

.travis.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ python:
88

99
sudo: false
1010

11+
services:
12+
- mysql
13+
- postgresql
14+
1115
addons:
1216
apt:
1317
packages:
@@ -18,7 +22,6 @@ cache:
1822
- node_modules
1923
- $HOME/.pip/cache
2024

21-
2225
env:
2326
global:
2427
# coveralls
@@ -83,6 +86,28 @@ matrix:
8386
env: DJANGO=2.1 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
8487
- python: 3.6
8588
env: TEST_DOCS=1 DJANGO=2.1 DATABASE_URL='sqlite://localhost/:memory:'
89+
90+
# DJANGO 2.2
91+
- python: 3.5
92+
env: DJANGO=2.2 DATABASE_URL='sqlite://localhost/:memory:'
93+
dist: xenial
94+
sudo: true
95+
- python: 3.5
96+
env: DJANGO=2.2 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
97+
- python: 3.6
98+
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
99+
- python: 3.6
100+
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
101+
- python: 3.6
102+
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
103+
- python: 3.6
104+
env: TEST_DOCS=1 DJANGO=2.2 DATABASE_URL='sqlite://localhost/:memory:'
105+
dist: xenial
106+
sudo: true
107+
108+
allow_failures:
109+
- python: 2.7
110+
env: DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
86111
exclude:
87112
- python: 2.7
88113
- python: 3.4

CHANGELOG.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
=== 3.6.0 (unreleased) ===
1+
2+
=== 3.7.0 (unreleased) ===
3+
4+
* Introduced Django 2.2 support.
5+
6+
7+
=== 3.6.0 (2019-01-29) ===
28

39
* Removed the ``cms moderator`` command.
410
* Dropped Django < 1.11 support.

cms/management/commands/subcommands/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from collections import OrderedDict
66

77
from django.core.management.base import BaseCommand, CommandParser
8-
from django.core.management.color import no_style
8+
from django.core.management.color import no_style, color_style
99

10-
from cms.utils.compat import DJANGO_2_0
10+
from cms.utils.compat import DJANGO_2_0, DJANGO_2_2
1111

1212

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

4144

4245
class SubcommandsCommand(BaseCommand):
@@ -85,6 +88,8 @@ def handle(self, *args, **options):
8588
if options.get('no_color'):
8689
command.style = no_style()
8790
command.stderr.style_func = None
91+
if DJANGO_2_2 and options.get('force_color'):
92+
command.style = color_style(force_color=True)
8893
if options.get('stdout'):
8994
command.stdout._out = options.get('stdout')
9095
if options.get('stderr'):

cms/test_utils/util/context_managers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __enter__(self):
2626
def __exit__(self, type, value, traceback):
2727
setattr(sys, 'std%s' % self.std, getattr(sys, '__std%s__' % self.std))
2828

29+
2930
class StdoutOverride(StdOverride):
3031
"""
3132
This overrides Python's the standard output and redirects it to a StringIO

cms/utils/compat/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
DJANGO_1_11 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.0')
1212
DJANGO_2_0 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.1')
1313
DJANGO_2_1 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.2')
14+
DJANGO_2_2 = LooseVersion(DJANGO_VERSION) < LooseVersion('3.0')

docs/upgrade/3.7.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
.. _upgrade-to-3.7.0:
2+
3+
###################
4+
3.7.0 release notes
5+
###################
6+
7+
This release of django CMS concentrates on introducing support for Django 2.2 LTS.
8+
9+
10+
*******************
11+
What's new in 3.7.0
12+
*******************
13+
14+
Improvements and new features
15+
=============================
16+
17+
* introduced support for Django 2.2
18+
19+
20+
*********************
21+
How to upgrade to 3.7
22+
*********************
23+
24+
We assume you are upgrading from django CMS 3.6.
25+
26+
Please make sure that your current database is consistent and in a healthy
27+
state, and **make a copy of the database before proceeding further.**
28+
29+
Then run::
30+
31+
python manage.py migrate # to ensure that your database is up-to-date with migrations
32+
python manage.py cms fix-tree
33+
34+
Check custom code and third-party applications for use of deprecated or removed functionality or
35+
APIs (see above). Some third-party components may need to be updated.
36+
37+
Install the new version of django CMS from GitHub or via pip.
38+
39+
Run::
40+
41+
python manage.py migrate
42+
43+
to apply the new migrations.
44+
45+
46+
***********************************
47+
Create a new django CMS 3.7 project
48+
***********************************
49+
50+
On the Divio Cloud
51+
==================
52+
53+
The Divio Cloud offers an easy way to set up django CMS projects. In the `Divio Cloud Control Panel
54+
<https://control.divio.com>`_, create a new django CMS project and **Deploy** it.
55+
56+
57+
Using the django CMS Installer
58+
==============================
59+
60+
.. note::
61+
62+
The django CMS Installer is not yet available for django CMS 3.6 or Django 2 or later.
63+
64+
This section will be updated or removed before the final release of django CMS 3.6.
65+
66+
67+
****************************
68+
Contributors to this release
69+
****************************
70+
71+
* Daniele Procida
72+
* Vadim Sikora
73+
* Paulo Alvarado
74+
* Bartosz Płóciennik
75+
* Katie McLaughlin
76+
* Krzysztof Socha
77+
* Mateusz Kamycki
78+
* Sergey Fedoseev
79+
* Aliaksei Urbanski
80+
* heppstux
81+
* Chematronix
82+
* Frank
83+
* Jacob Rief
84+
* Julz

docs/upgrade/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ makes changes to your database.
1313
.. toctree::
1414
:maxdepth: 1
1515

16+
3.7
17+
3.6
18+
3.5.3
1619
3.5.2
1720
3.5.1
1821
3.5

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
'Programming Language :: Python :: 3.4',
1919
'Programming Language :: Python :: 3.5',
2020
'Programming Language :: Python :: 3.6',
21+
'Programming Language :: Python :: 3.7',
2122
'Framework :: Django',
2223
'Framework :: Django :: 1.11',
2324
'Framework :: Django :: 2.0',
2425
'Framework :: Django :: 2.1',
26+
'Framework :: Django :: 2.2',
2527
]
2628

2729
INSTALL_REQUIREMENTS = [
28-
'Django>=1.11,<2.2',
30+
'Django>=1.11,<3.0',
2931
'django-classy-tags>=0.7.2',
3032
'django-formtools>=2.1',
3133
'django-treebeard>=4.3',

test_requirements/django-2.2.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-r requirements_base.txt
2+
Django>=2.2,<3.0

0 commit comments

Comments
 (0)
0