Repository: nephila/djangocms-installer
Pull request #297 (2017-01-03 15:21:28)

Add support for Django 1.10
* Add support for Django 1.10
* Add 'lts' keyword (it's now the default instead of 'stable')

coveralls: 
[![Coverage Status](https://coveralls.io/builds/9501212/badge)](https://coveralls.io/builds/9501212)

Coverage decreased (-0.6%) to 93.636% when pulling **8eb61ee6fe13b821d6c5f7def2d41c68aa970c0d on feature/django_110** into **d7a48d9ed906514ca067a3e85db7c927e25a96d3 on release/0.9.x**.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/9501212/badge)](https://coveralls.io/builds/9501212)

Coverage decreased (-0.6%) to 93.636% when pulling **8eb61ee6fe13b821d6c5f7def2d41c68aa970c0d on feature/django_110** into **d7a48d9ed906514ca067a3e85db7c927e25a96d3 on release/0.9.x**.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/9501212/badge)](https://coveralls.io/builds/9501212)

Coverage decreased (-0.6%) to 93.636% when pulling **8eb61ee6fe13b821d6c5f7def2d41c68aa970c0d on feature/django_110** into **d7a48d9ed906514ca067a3e85db7c927e25a96d3 on release/0.9.x**.

codecov-io: ## [Current coverage](https://codecov.io/gh/nephila/djangocms-installer/pull/297?src=pr) is 88.33% (diff: 82.22%)
> Merging [#297](https://codecov.io/gh/nephila/djangocms-installer/pull/297?src=pr) into [release/0.9.x](https://codecov.io/gh/nephila/djangocms-installer/branch/release/0.9.x?src=pr) will decrease coverage by **0.67%**

```diff
@@           release/0.9.x       #297   diff @@
===============================================
  Files                  8          8          
  Lines                646        660    +14   
  Methods                0          0          
  Messages               0          0          
  Branches             137        139     +2   
===============================================
+ Hits                 575        583     +8   
- Misses                37         42     +5   
- Partials              34         35     +1   
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [d7a48d9...8eb61ee](https://codecov.io/gh/nephila/djangocms-installer/compare/d7a48d9ed906514ca067a3e85db7c927e25a96d3...8eb61ee6fe13b821d6c5f7def2d41c68aa970c0d?src=pr)
coveralls: 
[![Coverage Status](https://coveralls.io/builds/9502101/badge)](https://coveralls.io/builds/9502101)

Coverage decreased (-0.2%) to 94.091% when pulling **dcc8f6207e3726ff43f36373356e3d0fa2833f98 on feature/django_110** into **d7a48d9ed906514ca067a3e85db7c927e25a96d3 on release/0.9.x**.


Patch:
diff --git a/HISTORY.rst b/HISTORY.rst
index 8cc0355..a8f01ae 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -3,6 +3,12 @@
 History
 -------
 
+0.9.4 (unreleased)
+++++++++++++++++++
+
+* Added support for Django 1.10
+* Added 'lts' keyword (it's now the default instead of 'stable')
+
 0.9.3 (2016-11-16)
 ++++++++++++++++++
 
diff --git a/README.rst b/README.rst
index 5b03782..528a25f 100644
--- a/README.rst
+++ b/README.rst
@@ -102,7 +102,7 @@ The current supported version matrix is the following:
 +----------------+-------------+-------------+---------------+
 | django CMS 3.3 | Supported   | Supported   | Unsupported   |
 +----------------+-------------+-------------+---------------+
-| django CMS 3.4 | Supported   | Supported   | WiP           |
+| django CMS 3.4 | Supported   | Supported   | Supported     |
 +----------------+-------------+-------------+---------------+
 
 See `version 0.8`_ for older Django / django CMS versions support
diff --git a/djangocms_installer/config/__init__.py b/djangocms_installer/config/__init__.py
index 002a5bf..80980c9 100644
--- a/djangocms_installer/config/__init__.py
+++ b/djangocms_installer/config/__init__.py
@@ -6,6 +6,7 @@ import locale
 import os.path
 import sys
 import warnings
+from distutils.version import LooseVersion
 
 import six
 from tzlocal import get_localzone
@@ -76,10 +77,10 @@ information.
                              'be used here. Example: en, fr-FR, it-IT')
     parser.add_argument('--django-version', dest='django_version', action='store',
                         choices=data.DJANGO_SUPPORTED,
-                        default='stable', help='Django version')
+                        default='lts', help='Django version')
     parser.add_argument('--cms-version', '-v', dest='cms_version', action='store',
                         choices=data.DJANGOCMS_SUPPORTED,
-                        default='stable', help='django CMS version')
+                        default='lts', help='django CMS version')
     parser.add_argument('--parent-dir', '-p', dest='project_directory',
                         default='',
                         action='store', help='Optional project parent directory')
@@ -255,11 +256,11 @@ information.
 
         if args.cms_version in ('rc', 'develop'):
             requirements.extend(data.REQUIREMENTS['cms-master'])
-        elif cms_version >= 3.4:
+        elif LooseVersion(cms_version) >= LooseVersion('3.4'):
             requirements.extend(data.REQUIREMENTS['cms-3.4'])
-        elif cms_version >= 3.3:
+        elif LooseVersion(cms_version) >= LooseVersion('3.3'):
             requirements.extend(data.REQUIREMENTS['cms-3.3'])
-        elif cms_version >= 3.2:
+        elif LooseVersion(cms_version) >= LooseVersion('3.2'):
             requirements.extend(data.REQUIREMENTS['cms-3.2'])
 
         if not args.no_db_driver:
@@ -267,9 +268,9 @@ information.
         if not args.no_plugins:
             if args.cms_version in ('rc', 'develop'):
                 requirements.extend(data.REQUIREMENTS['plugins-master'])
-            elif cms_version >= 3.4:
+            elif LooseVersion(cms_version) >= LooseVersion('3.4'):
                 requirements.extend(data.REQUIREMENTS['plugins-3.4'])
-            elif cms_version >= 3.3:
+            elif LooseVersion(cms_version) >= LooseVersion('3.3'):
                 requirements.extend(data.REQUIREMENTS['plugins-3.3'])
             else:
                 requirements.extend(data.REQUIREMENTS['plugins-3.2'])
@@ -293,16 +294,18 @@ information.
             requirements.append('pytz')
 
         # Reversion package version depends on django version
-        if args.reversion and cms_version in (3.2, 3.3):
-            if django_version == 1.8:
+        if args.reversion and cms_version in ('3.2', '3.3'):
+            if django_version == '1.8':
                 requirements.extend(data.REQUIREMENTS['reversion-django-1.8'])
-            elif django_version == 1.9:
+            elif django_version == '1.9':
                 requirements.extend(data.REQUIREMENTS['reversion-django-1.9'])
 
-        if django_version == 1.8:
+        if django_version == '1.8':
             requirements.extend(data.REQUIREMENTS['django-1.8'])
-        elif django_version == 1.9:
+        elif django_version == '1.9':
             requirements.extend(data.REQUIREMENTS['django-1.9'])
+        elif django_version == '1.10':
+            requirements.extend(data.REQUIREMENTS['django-1.10'])
 
         requirements.extend(data.REQUIREMENTS['default'])
 
diff --git a/djangocms_installer/config/data.py b/djangocms_installer/config/data.py
index ed0283e..01e79d5 100644
--- a/djangocms_installer/config/data.py
+++ b/djangocms_installer/config/data.py
@@ -20,44 +20,52 @@ DJANGOCMS_RC = 'https://github.com/divio/django-cms/archive/release/3.4.x.zip?{b
 DJANGOCMS_BETA = 'https://github.com/divio/django-cms/archive/3.0.0.beta3.zip'
 
 if sys.version_info >= (3, 5):
-    DJANGOCMS_SUPPORTED = ('3.2', '3.3', '3.4', 'stable', 'develop')
-    DJANGOCMS_STABLE = 3.4
+    DJANGOCMS_SUPPORTED = ('3.2', '3.3', '3.4', 'stable', 'lts', 'develop')
+    DJANGOCMS_STABLE = '3.4'
+    DJANGOCMS_LTS = '3.4'
 else:
-    DJANGOCMS_SUPPORTED = ('3.2', '3.3', '3.4', 'stable', 'develop')
-    DJANGOCMS_STABLE = 3.4
+    DJANGOCMS_SUPPORTED = ('3.2', '3.3', '3.4', 'stable', 'lts', 'develop')
+    DJANGOCMS_STABLE = '3.4'
+    DJANGOCMS_LTS = '3.4'
 
 DJANGO_DEVELOP = 'https://github.com/django/django/archive/master.zip?{bust}'.format(**bust)
 DJANGO_BETA = 'https://github.com/django/django/archive/master.zip?{bust}'.format(**bust)
 if sys.version_info >= (3, 5):
-    DJANGO_SUPPORTED = ('1.8', '1.9', 'stable')
-    DJANGO_STABLE = 1.8
+    DJANGO_SUPPORTED = ('1.8', '1.9', '1.10', 'stable', 'lts')
+    DJANGO_STABLE = '1.10'
+    DJANGO_LTS = '1.8'
 elif sys.version_info >= (3, 4):
-    DJANGO_SUPPORTED = ('1.8', '1.9', 'stable')
-    DJANGO_STABLE = 1.8
+    DJANGO_SUPPORTED = ('1.8', '1.9', '1.10', 'stable', 'lts')
+    DJANGO_STABLE = '1.10'
+    DJANGO_LTS = '1.8'
 elif sys.version_info >= (3, 3):
-    DJANGO_SUPPORTED = ('1.8', 'stable')
-    DJANGO_STABLE = 1.8
+    DJANGO_SUPPORTED = ('1.8', 'stable', 'lts')
+    DJANGO_STABLE = '1.8'
+    DJANGO_LTS = '1.8'
 else:
-    DJANGO_SUPPORTED = ('1.8', '1.9', 'stable')
-    DJANGO_STABLE = 1.8
+    DJANGO_SUPPORTED = ('1.8', '1.9', '1.10', 'stable', 'lts')
+    DJANGO_STABLE = '1.10'
+    DJANGO_LTS = '1.8'
 
 CMS_VERSION_MATRIX = {
     'stable': DJANGOCMS_STABLE,
-    'rc': 3.5,
-    'beta': 3.5,
-    'develop': 3.5
+    'lts': DJANGOCMS_LTS,
+    'rc': '3.5',
+    'beta': '3.5',
+    'develop': '3.5'
 }
 DJANGO_VERSION_MATRIX = {
     'stable': DJANGO_STABLE,
-    'rc': 1.9,
-    'beta': 1.9,
-    'develop': 1.9
+    'lts': DJANGO_LTS,
+    'rc': '1.11',
+    'beta': '1.11',
+    'develop': '1.11'
 }
 VERSION_MATRIX = {
-    3.2: (1.8, 1.9),
-    3.3: (1.8, 1.9),
-    3.4: (1.8, 1.9, 1.10),
-    3.5: (1.8, 1.9, 1.10),
+    '3.2': ('1.8', '1.9'),
+    '3.3': ('1.8', '1.9'),
+    '3.4': ('1.8', '1.10'),
+    '3.5': ('1.8', '1.10'),
 }
 
 REQUIREMENTS = {
@@ -73,12 +81,17 @@ REQUIREMENTS = {
     ],
     'django-1.9': [
     ],
+    'django-1.10': [
+    ],
     'reversion-django-1.8': [
         'django-reversion>=1.10,<1.11',
     ],
     'reversion-django-1.9': [
         'django-reversion>=1.10,<2.0',
     ],
+    'reversion-django-1.10': [
+        'django-reversion>=2.0,<2.1',
+    ],
     'cms-3.2': [
         'djangocms-admin-style>=1.1.1,<1.3',
         'django-treebeard>=4.0,<5.0',
diff --git a/djangocms_installer/django/__init__.py b/djangocms_installer/django/__init__.py
index 0e2c834..fd8e0fe 100644
--- a/djangocms_installer/django/__init__.py
+++ b/djangocms_installer/django/__init__.py
@@ -11,6 +11,7 @@ import tempfile
 import textwrap
 import zipfile
 from copy import copy, deepcopy
+from distutils.version import LooseVersion
 
 from six import BytesIO, iteritems
 
@@ -223,7 +224,7 @@ STATICFILES_DIRS = (
         )
 
     for item in overridden_settings:
-        if config_data.django_version >= 1.9:
+        if LooseVersion(config_data.django_version) >= LooseVersion('1.9'):
             item_re = re.compile(r'{0} = [^\]]+\]'.format(item), re.DOTALL | re.MULTILINE)
         else:
             item_re = re.compile(r'{0} = [^\)]+\)'.format(item), re.DOTALL | re.MULTILINE)
@@ -278,7 +279,7 @@ def _build_settings(config_data):
 
     if config_data.aldryn:  # pragma: no cover
         apps.extend(vars.ALDRYN_APPLICATIONS)
-    if config_data.reversion and config_data.cms_version < 3.4:
+    if config_data.reversion and LooseVersion(config_data.cms_version) < LooseVersion('3.4'):
         apps.extend(vars.REVERSION_APPLICATIONS)
     text.append('INSTALLED_APPS = (\n{0}{1}\n)'.format(
         spacer, (',\n' + spacer).join(['\'{0}\''.format(var) for var in apps] +
diff --git a/djangocms_installer/utils.py b/djangocms_installer/utils.py
index e1071f9..164b2f1 100644
--- a/djangocms_installer/utils.py
+++ b/djangocms_installer/utils.py
@@ -4,6 +4,9 @@ from __future__ import absolute_import, print_function, unicode_literals
 import os
 import sys
 
+from decimal import Decimal, InvalidOperation
+from distutils.version import LooseVersion
+
 from six import text_type
 
 from . import compat
@@ -43,8 +46,7 @@ def query_yes_no(question, default=None):  # pragma: no cover
         elif choice in valid:
             return valid[choice]
         else:
-            sys.stdout.write('Please answer with "yes" or "no" '
-                             '(or "y" or "n").\n')
+            sys.stdout.write('Please answer with "yes" or "no" (or "y" or "n").\n')
 
 
 def supported_versions(django, cms):
@@ -53,26 +55,29 @@ def supported_versions(django, cms):
     """
     cms_version = None
     django_version = None
+
     try:
-        cms_version = float(cms)
-    except ValueError:
+        cms_version = Decimal(cms)
+    except (ValueError, InvalidOperation):
         try:
-            cms_version = CMS_VERSION_MATRIX[cms]
+            cms_version = CMS_VERSION_MATRIX[str(cms)]
         except KeyError:
             pass
 
     try:
-        django_version = float(django)
-    except ValueError:
+        django_version = Decimal(django)
+    except (ValueError, InvalidOperation):
         try:
-            django_version = DJANGO_VERSION_MATRIX[django]
+            django_version = DJANGO_VERSION_MATRIX[str(django)]
         except KeyError:  # pragma: no cover
             pass
+
     try:
         if (
                 cms_version and django_version and
-                not (VERSION_MATRIX[cms_version][0] <= django_version <=
-                     VERSION_MATRIX[cms_version][1])
+                not (LooseVersion(VERSION_MATRIX[compat.unicode(cms_version)][0]) <=
+                     LooseVersion(compat.unicode(django_version)) <=
+                     LooseVersion(VERSION_MATRIX[compat.unicode(cms_version)][1]))
         ):
             raise RuntimeError(
                 'Django and django CMS versions doesn\'t match: '
@@ -83,7 +88,10 @@ def supported_versions(django, cms):
             'Django and django CMS versions doesn\'t match: '
             'Django {0} is not supported by django CMS {1}'.format(django_version, cms_version)
         )
-    return django_version, cms_version
+    return (
+        compat.unicode(django_version) if django_version else django_version,
+        compat.unicode(cms_version) if cms_version else cms_version
+    )
 
 
 def less_than_version(value):
diff --git a/docs/reference.rst b/docs/reference.rst
index 820e699..9f59357 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -38,17 +38,19 @@ The following arguments can be overridden in :ref:`wizard_mode`
   times, or as a comma separated list.
   Only language codes supported by Django can be used here;
   refer to `django source`_ for a list of supported codes.
-* ``--django-version``: Django version;  choices: ``1.8|1.9|stable``, default: ``stable``
-* ``--cms-version``, ``-v``: django CMS version, choices: ``3.2|3.3|stable|rc|develop``.
-  default: ``stable``
+* ``--django-version``: Django version;  choices: ``1.8|1.9|1.10|stable|lts``, default: ``lts```
+* ``--cms-version``, ``-v``: django CMS version, choices: ``3.2|3.3|3.4|stable|lts``.
+  default: ``lts``
 * ``--bootstrap``: Use Twitter Bootstrap as theme, choices: ``yes|no``, default: ``no``
 * ``--starting-page``: Load a starting page with examples (available for english language only)
   after installation, choices: ``yes|no``, default: ``no``
 * ``--templates``: Use a custom directory as template source; is checked to be a valid path,
   otherwise the shipped templates are used
 
-.. note:: ``stable`` keyword is expanded to Django version 1.8
-.. note:: ``stable`` keyword is expanded to django CMS version 3.3
+.. note:: Django ``stable`` keyword is expanded to latest released Django version
+.. note:: Django ``lts`` keyword is expanded to latest released Django LTSrsion
+.. note:: django-cms ``stable`` keyword is expanded to latest released django-cms version
+.. note:: django-cms ``lts`` keyword is expanded to latest released django-cms version
 .. warning:: if an unsupported combination of Django and django CMS version is selected, the
              wizard exits reporting the error.
 


Test patch:
diff --git a/tests/config.py b/tests/config.py
index 3a80c0f..5871e8e 100644
--- a/tests/config.py
+++ b/tests/config.py
@@ -26,8 +26,8 @@ class TestConfig(BaseTestClass):
 
         self.assertEqual(conf_data.project_name, 'example_prj')
 
-        self.assertEqual(conf_data.cms_version, 3.4)
-        self.assertEqual(conf_data.django_version, 1.8)
+        self.assertEqual(conf_data.cms_version, '3.4')
+        self.assertEqual(conf_data.django_version, '1.8')
         self.assertEqual(conf_data.i18n, 'yes')
         self.assertEqual(conf_data.reversion, 'yes')
         self.assertEqual(conf_data.permissions, 'no')
@@ -58,8 +58,8 @@ class TestConfig(BaseTestClass):
 
         self.assertEqual(conf_data.project_name, 'example_prj')
 
-        self.assertEqual(conf_data.cms_version, 3.4)
-        self.assertEqual(conf_data.django_version, 1.8)
+        self.assertEqual(conf_data.cms_version, '3.4')
+        self.assertEqual(conf_data.django_version, '1.8')
         self.assertEqual(conf_data.i18n, 'yes')
         self.assertEqual(conf_data.reversion, 'no')
         self.assertEqual(conf_data.permissions, 'no')
@@ -294,22 +294,31 @@ class TestConfig(BaseTestClass):
         self.assertEqual(less_than_version('3.0.1'), '3.1.1')
 
     def test_supported_versions(self):
-        self.assertEqual(supported_versions('stable', 'stable'), (1.8, 3.4))
-        self.assertEqual(supported_versions('stable', '3.1.10'), (1.8, None))
-        self.assertEqual(supported_versions('stable', 'rc'), (1.8, 3.5))
-        self.assertEqual(supported_versions('stable', 'beta'), (1.8, 3.5))
-        self.assertEqual(supported_versions('stable', 'develop'), (1.8, 3.5))
+
+        if (3, 3) <= sys.version_info <= (3, 4):
+            self.assertEqual(supported_versions('stable', 'stable'), ('1.8', '3.4'))
+            self.assertEqual(supported_versions('stable', '3.1.10'), ('1.8', None))
+            self.assertEqual(supported_versions('stable', 'rc'), ('1.8', '3.5'))
+            self.assertEqual(supported_versions('stable', 'beta'), ('1.8', '3.5'))
+            self.assertEqual(supported_versions('stable', 'develop'), ('1.8', '3.5'))
+        else:
+            self.assertEqual(supported_versions('stable', 'stable'), ('1.10', '3.4'))
+            self.assertEqual(supported_versions('stable', '3.1.10'), ('1.10', None))
+            self.assertEqual(supported_versions('stable', 'rc'), ('1.10', '3.5'))
+            self.assertEqual(supported_versions('stable', 'beta'), ('1.10', '3.5'))
+            self.assertEqual(supported_versions('stable', 'develop'), ('1.10', '3.5'))
+        self.assertEqual(supported_versions('lts', 'rc'), ('1.8', '3.5'))
+        self.assertEqual(supported_versions('lts', 'lts'), ('1.8', '3.4'))
 
         with self.assertRaises(RuntimeError):
-            supported_versions('stable', '2.4'), (1.5, 2.4)
+            supported_versions('stable', '2.4'), ('1.5', '2.4')
         with self.assertRaises(RuntimeError):
-            supported_versions('1.5', 'stable'), (1.8, 3.1)
+            supported_versions('1.5', 'stable'), ('1.8', '3.1')
 
-        self.assertEqual(supported_versions('1.9', 'stable'), (1.9, 3.4))
-        self.assertEqual(supported_versions('1.8', 'stable'), (1.8, 3.4))
-        self.assertEqual(supported_versions('1.8.3', 'stable'), (None, 3.4))
-        self.assertEqual(supported_versions('beta', 'stable'), (1.9, 3.4))
-        self.assertEqual(supported_versions('develop', 'stable'), (1.9, 3.4))
+        self.assertEqual(supported_versions('1.9', 'stable'), ('1.9', '3.4'))
+        self.assertEqual(supported_versions('1.8', 'stable'), ('1.8', '3.4'))
+        self.assertEqual(supported_versions('1.8', 'lts'), ('1.8', '3.4'))
+        self.assertEqual(supported_versions('1.8.3', 'stable'), (None, '3.4'))
 
     def test_requirements(self):
         """
@@ -346,7 +355,10 @@ class TestConfig(BaseTestClass):
             'example_prj'])
 
         self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
-        self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
+        if (3, 3) <= sys.version_info <= (3, 4):
+            self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
+        else:
+            self.assertTrue(conf_data.requirements.find('Django<1.11') > -1)
         self.assertFalse(conf_data.requirements.find('django-reversion') > -1)
         self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.2.1') > -1)
         self.assertTrue(conf_data.requirements.find('djangocms-admin-style>=1.2') > -1)
@@ -366,7 +378,7 @@ class TestConfig(BaseTestClass):
             '--db=postgres://user:pwd@host/dbname',
             '--i18n=no',
             '--cms-version=develop',
-            '--django-version=stable',
+            '--django-version=lts',
             '-f',
             '--reversion=yes',
             '-p'+self.project_dir,
@@ -421,7 +433,10 @@ class TestConfig(BaseTestClass):
             'example_prj'])
 
         self.assertTrue(conf_data.requirements.find(config.data.DJANGOCMS_DEVELOP) > -1)
-        self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
+        if (3, 3) <= sys.version_info <= (3, 4):
+            self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
+        else:
+            self.assertTrue(conf_data.requirements.find('Django<1.11') > -1)
         self.assertFalse(conf_data.requirements.find('django-reversion') > -1)
         self.assertTrue(conf_data.requirements.find('https://github.com/divio/djangocms-link') > -1)
         self.assertTrue(conf_data.requirements.find('https://github.com/divio/djangocms-style') > -1)
@@ -447,7 +462,10 @@ class TestConfig(BaseTestClass):
             'example_prj'])
 
         self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
-        self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
+        if (3, 3) <= sys.version_info <= (3, 4):
+            self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
+        else:
+            self.assertTrue(conf_data.requirements.find('Django<1.11') > -1)
         self.assertFalse(conf_data.requirements.find('django-reversion') > -1)
         self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.2') > -1)
         self.assertTrue(conf_data.requirements.find('djangocms-admin-style') > -1)
@@ -458,7 +476,7 @@ class TestConfig(BaseTestClass):
             '--db=postgres://user:pwd@host/dbname',
             '--i18n=no',
             '--cms-version=3.3',
-            '--django-version=stable',
+            '--django-version=lts',
             '-f',
             '--reversion=yes',
             '-z=yes',
@@ -534,6 +552,33 @@ class TestConfig(BaseTestClass):
         self.assertTrue(conf_data.requirements.find('djangocms-teaser/archive/master.zip') == -1)
         self.assertTrue(conf_data.requirements.find('south') == -1)
 
+        conf_data = config.parse([
+            '-q',
+            '--db=postgres://user:pwd@host/dbname',
+            '--cms-version=lts',
+            '--django-version=lts',
+            '-p'+self.project_dir,
+            'example_prj'])
+
+        self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
+        self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
+        self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
+
+        conf_data = config.parse([
+            '-q',
+            '--db=postgres://user:pwd@host/dbname',
+            '--cms-version=stable',
+            '--django-version=stable',
+            '-p'+self.project_dir,
+            'example_prj'])
+
+        self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
+        if (3, 3) <= sys.version_info <= (3, 4):
+            self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
+        else:
+            self.assertTrue(conf_data.requirements.find('Django<1.11') > -1)
+        self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
+
     def disabled_test_aldryn_compatibility(self):
         with patch('sys.stdout', self.stdout):
             with patch('sys.stderr', self.stderr):
@@ -707,11 +752,15 @@ class TestBaseConfig(unittest.TestCase):
     base_dir = os.path.dirname(os.path.dirname(__file__))
     config_dir = os.path.join(base_dir, 'tests/fixtures/configs')
     args = ['--config-file', '-s', '-q', 'example_prj']
+    if (3, 3) <= sys.version_info <= (3, 4):
+        django_version = '1.8'
+    else:
+        django_version = DJANGO_VERSION_MATRIX['lts']
     config_fixture = Namespace(**{
         'bootstrap': False,
-        'cms_version': CMS_VERSION_MATRIX['stable'],
+        'cms_version': CMS_VERSION_MATRIX['lts'],
         'db': 'sqlite://localhost/project.db',
-        'django_version': DJANGO_VERSION_MATRIX['stable'],
+        'django_version': django_version,
         'dump_reqs': False,
         'extra_settings': None,
         'filer': True,
@@ -782,7 +831,7 @@ class TestBaseConfig(unittest.TestCase):
             ('config-07.ini', 'permissions', 'no'),
             ('config-08.ini', None, (('i18n', 'no'), ('languages', ['ru']))),
             ('config-09.ini', None, (('i18n', 'yes'), ('languages', ['en', 'ru']))),
-            ('config-10.ini', 'django_version', 1.8),
+            ('config-10.ini', 'django_version', '1.8'),
             ('config-11.ini', 'project_directory', '/test/me'),
             ('config-12.ini', 'bootstrap', True),
             ('config-13.ini', 'templates', '.'),
diff --git a/tests/fixtures/configs/config-01.ini b/tests/fixtures/configs/config-01.ini
index 4fc4811..3fdd146 100644
--- a/tests/fixtures/configs/config-01.ini
+++ b/tests/fixtures/configs/config-01.ini
@@ -6,7 +6,7 @@ timezone =
 reversion = yes
 permissions = yes
 languages =
-django-version = stable
+django-version = lts
 cms-version = stable
 parent-dir = .
 bootstrap = no
diff --git a/tests/fixtures/configs/config-02.ini b/tests/fixtures/configs/config-02.ini
index 1828f1e..50c2f2d 100644
--- a/tests/fixtures/configs/config-02.ini
+++ b/tests/fixtures/configs/config-02.ini
@@ -6,7 +6,7 @@ timezone =
 reversion = yes
 permissions = yes
 languages =
-django-version = stable
+django-version = lts
 cms-version = stable
 parent-dir = .
 bootstrap = no
diff --git a/tests/fixtures/configs/config-03.ini b/tests/fixtures/configs/config-03.ini
index a82701b..7a9f836 100644
--- a/tests/fixtures/configs/config-03.ini
+++ b/tests/fixtures/configs/config-03.ini
@@ -6,7 +6,7 @@ timezone =
 reversion = yes
 permissions = yes
 languages =
-django-version = stable
+django-version = lts
 cms-version = stable
 parent-dir = .
 bootstrap = no
diff --git a/tests/fixtures/configs/config-04.ini b/tests/fixtures/configs/config-04.ini
index 0004ae5..f200859 100644
--- a/tests/fixtures/configs/config-04.ini
+++ b/tests/fixtures/configs/config-04.ini
@@ -6,7 +6,7 @@ timezone =
 reversion = yes
 permissions = yes
 languages =
-django-version = stable
+django-version = lts
 cms-version = stable
 parent-dir = .
 bootstrap = no
diff --git a/tests/fixtures/configs/config-05.ini b/tests/fixtures/configs/config-05.ini
index d744303..643cc8b 100644
--- a/tests/fixtures/configs/config-05.ini
+++ b/tests/fixtures/configs/config-05.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = yes
 permissions = yes
 languages =
-django-version = stable
+django-version = lts
 cms-version = stable
 parent-dir = .
 bootstrap = no
diff --git a/tests/fixtures/configs/config-06.ini b/tests/fixtures/configs/config-06.ini
index 792687e..8817831 100644
--- a/tests/fixtures/configs/config-06.ini
+++ b/tests/fixtures/configs/config-06.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = yes
 languages =
-django-version = stable
+django-version = lts
 cms-version = stable
 parent-dir = .
 bootstrap = no
diff --git a/tests/fixtures/configs/config-07.ini b/tests/fixtures/configs/config-07.ini
index a715e52..9794f1e 100644
--- a/tests/fixtures/configs/config-07.ini
+++ b/tests/fixtures/configs/config-07.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages =
-django-version = stable
+django-version = lts
 cms-version = stable
 parent-dir = .
 bootstrap = no
diff --git a/tests/fixtures/configs/config-08.ini b/tests/fixtures/configs/config-08.ini
index 96d4926..2baa391 100644
--- a/tests/fixtures/configs/config-08.ini
+++ b/tests/fixtures/configs/config-08.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = .
 bootstrap = no
diff --git a/tests/fixtures/configs/config-09.ini b/tests/fixtures/configs/config-09.ini
index 7c0cc40..07fc14e 100644
--- a/tests/fixtures/configs/config-09.ini
+++ b/tests/fixtures/configs/config-09.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = stable
 parent-dir = .
 bootstrap = no
diff --git a/tests/fixtures/configs/config-11.ini b/tests/fixtures/configs/config-11.ini
index 2904f4d..1a829d7 100644
--- a/tests/fixtures/configs/config-11.ini
+++ b/tests/fixtures/configs/config-11.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = no
diff --git a/tests/fixtures/configs/config-12.ini b/tests/fixtures/configs/config-12.ini
index 7d10dc4..5db47f7 100644
--- a/tests/fixtures/configs/config-12.ini
+++ b/tests/fixtures/configs/config-12.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-13.ini b/tests/fixtures/configs/config-13.ini
index 5499e93..830a926 100644
--- a/tests/fixtures/configs/config-13.ini
+++ b/tests/fixtures/configs/config-13.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-14.ini b/tests/fixtures/configs/config-14.ini
index c8d3255..68e29d5 100644
--- a/tests/fixtures/configs/config-14.ini
+++ b/tests/fixtures/configs/config-14.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-15.ini b/tests/fixtures/configs/config-15.ini
index 040e5cb..29aa80c 100644
--- a/tests/fixtures/configs/config-15.ini
+++ b/tests/fixtures/configs/config-15.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-16.ini b/tests/fixtures/configs/config-16.ini
index 8bc7dbb..d489d61 100644
--- a/tests/fixtures/configs/config-16.ini
+++ b/tests/fixtures/configs/config-16.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-17.ini b/tests/fixtures/configs/config-17.ini
index 37ac545..84dea64 100644
--- a/tests/fixtures/configs/config-17.ini
+++ b/tests/fixtures/configs/config-17.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-18.ini b/tests/fixtures/configs/config-18.ini
index 37ac545..84dea64 100644
--- a/tests/fixtures/configs/config-18.ini
+++ b/tests/fixtures/configs/config-18.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-19.ini b/tests/fixtures/configs/config-19.ini
index d476e93..5dc7758 100644
--- a/tests/fixtures/configs/config-19.ini
+++ b/tests/fixtures/configs/config-19.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-20.ini b/tests/fixtures/configs/config-20.ini
index 0d416de..f87bde3 100644
--- a/tests/fixtures/configs/config-20.ini
+++ b/tests/fixtures/configs/config-20.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-21.ini b/tests/fixtures/configs/config-21.ini
index 183d86b..a0cd16b 100644
--- a/tests/fixtures/configs/config-21.ini
+++ b/tests/fixtures/configs/config-21.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-22.ini b/tests/fixtures/configs/config-22.ini
index 81d43b5..55a2aa7 100644
--- a/tests/fixtures/configs/config-22.ini
+++ b/tests/fixtures/configs/config-22.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-23.ini b/tests/fixtures/configs/config-23.ini
index c244b37..15bb3d6 100644
--- a/tests/fixtures/configs/config-23.ini
+++ b/tests/fixtures/configs/config-23.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-24.ini b/tests/fixtures/configs/config-24.ini
index 47d063a..6946506 100644
--- a/tests/fixtures/configs/config-24.ini
+++ b/tests/fixtures/configs/config-24.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-25.ini b/tests/fixtures/configs/config-25.ini
index 6ae2a55..a7cebd2 100644
--- a/tests/fixtures/configs/config-25.ini
+++ b/tests/fixtures/configs/config-25.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-26.ini b/tests/fixtures/configs/config-26.ini
index 3abc985..1a87a91 100644
--- a/tests/fixtures/configs/config-26.ini
+++ b/tests/fixtures/configs/config-26.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-27.ini b/tests/fixtures/configs/config-27.ini
index 0c7b33d..079579f 100644
--- a/tests/fixtures/configs/config-27.ini
+++ b/tests/fixtures/configs/config-27.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-28.ini b/tests/fixtures/configs/config-28.ini
index 4bc3115..7d74058 100644
--- a/tests/fixtures/configs/config-28.ini
+++ b/tests/fixtures/configs/config-28.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-30.ini b/tests/fixtures/configs/config-30.ini
index b076a5d..ea496a8 100644
--- a/tests/fixtures/configs/config-30.ini
+++ b/tests/fixtures/configs/config-30.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes
diff --git a/tests/fixtures/configs/config-32.ini b/tests/fixtures/configs/config-32.ini
index 7a935c2..2a587d6 100644
--- a/tests/fixtures/configs/config-32.ini
+++ b/tests/fixtures/configs/config-32.ini
@@ -6,7 +6,7 @@ timezone = Europe/London
 reversion = no
 permissions = no
 languages = en,ru
-django-version = stable
+django-version = lts
 cms-version = 3.4
 parent-dir = /test/me
 bootstrap = yes