Python django.__version__() Examples

The following are 6 code examples for showing how to use django.__version__(). These examples are extracted from open source projects. 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 check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module django , or try the search function .

Example 1
Project: django-cachalot   Author: noripyt   File: apps.py    License: 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
Project: djongo   Author: nesdis   File: tests.py    License: 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
Project: djongo   Author: nesdis   File: tests.py    License: 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
Project: django-distill   Author: meeb   File: __init__.py    License: 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
Project: django-distill   Author: meeb   File: __init__.py    License: 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
Project: django-distill   Author: meeb   File: __init__.py    License: 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))