django.get_django_version - python examples

Here are the examples of the python api django.get_django_version taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

3 View Complete Implementation : context_processors.py
Copyright MIT License
Author : monim67
def site_context(request):
    context = {
        'django_version': DJANGO_VERSION,
        'django_version_string': get_django_version(),
    }
    return context

3 View Complete Implementation : context_processors.py
Copyright Apache License 2.0
Author : monim67
def demo_context(request):
    context = {
        'django_version': django_version,
        'django_version_string': get_django_version(),
        'url_section': '',
        'url_sub_section': '',
        'bootstrap_version': '',
        'bootstrap4_supported': django_version > (1, 11),
    }
    url_name_parts = request.resolver_match.url_name.split('.', 1)
    if len(url_name_parts) == 2 and url_name_parts[0][:-1] == 'bootstrap':
        context['url_section'] = url_name_parts[0]
        context['url_sub_section'] = url_name_parts[1]
        context['bootstrap_version'] = int(url_name_parts[0][-1])
    return context