Python django.__version__() Examples

The following are 6 code examples of django.__version__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django , or try the search function .
Example #1
Source File: apps.py    From django-cachalot with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def check_django_version(app_configs, **kwargs):
    if not (2, 0) <= django_version < (3, 1):
        return [Error(
            'Django %s is not compatible with this version of django-cachalot.'
            % django__version__,
            hint='Refer to the django-cachalot documentation to find '
                 'which versions are compatible.',
            id='cachalot.E003')]
    return [] 
Example #2
Source File: tests.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def test_command_option(self):
        with self.assertLogs('test', 'INFO') as cm:
            call_command(
                'shell',
                command=(
                    'import django; from logging import getLogger; '
                    'getLogger("test").info(django.__version__)'
                ),
            )
        self.assertEqual(cm.records[0].getMessage(), __version__) 
Example #3
Source File: tests.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def test_command_option(self):
        with self.assertLogs('test', 'INFO') as cm:
            call_command(
                'shell',
                command=(
                    'import django; from logging import getLogger; '
                    'getLogger("test").info(django.__version__)'
                ),
            )
        self.assertEqual(cm.records[0].getMessage(), __version__) 
Example #4
Source File: __init__.py    From django-distill with MIT License 5 votes vote down vote up
def distill_url(*args, **kwargs):
        err = ('Your installed version of Django ({}) does not supprt '
               'django.urls.url or django.conf.urls.url, use '
               'django_distill.distill_re_path or django_distill.distill_path')
        raise DistillError(err.format(django_version)) 
Example #5
Source File: __init__.py    From django-distill with MIT License 5 votes vote down vote up
def distill_re_path(*args, **kwargs):
        err = ('Your installed version of Django ({}) does not supprt '
               'django.urls.re_path, please upgrade')
        raise DistillError(err.format(django_version)) 
Example #6
Source File: __init__.py    From django-distill with MIT License 5 votes vote down vote up
def distill_path(*args, **kwargs):
        err = ('Your installed version of Django ({}) does not supprt '
               'django.urls.path, please upgrade')
        raise DistillError(err.format(django_version))