本文整理汇总了Python中django.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python django.__version__方法的具体用法?Python django.__version__怎么用?Python django.__version__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django
的用法示例。
在下文中一共展示了django.__version__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_django_version
# 需要导入模块: import django [as 别名]
# 或者: from django import __version__ [as 别名]
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 []
示例2: test_command_option
# 需要导入模块: import django [as 别名]
# 或者: from django import __version__ [as 别名]
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__)
示例3: distill_url
# 需要导入模块: import django [as 别名]
# 或者: from django import __version__ [as 别名]
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))
示例4: distill_re_path
# 需要导入模块: import django [as 别名]
# 或者: from django import __version__ [as 别名]
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))
示例5: distill_path
# 需要导入模块: import django [as 别名]
# 或者: from django import __version__ [as 别名]
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))