本文整理匯總了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))