--- id: django-nine version: "0.2.7" license: GPL-2.0-only OR LGPL-2.1-or-later license_treatment: copyleft maintenance: active --- # django-nine — Version checking library. License: copyleft · Maintenance: active · Downloads: 174.2K/mo ## What it is and what it does django-nine is a compatibility library that exposes boolean constants for each Django version, letting you write version-aware code without manual version parsing. It provides constants like `DJANGO_1_7`, `DJANGO_GTE_1_8`, and `DJANGO_LTE_2_0` that evaluate to True or False based on the installed Django version, and can be used in Python code or injected into Django templates via a context processor. The library is designed for projects that need to support multiple Django versions simultaneously—a common requirement during Django upgrades. Instead of checking `django.VERSION` manually, you import pre-defined version flags and use them in conditional logic. It depends only on Django and packaging, making it a lightweight addition to any Django project. Use it for: - Support multiple Django versions in a single codebase during a gradual Django upgrade - Conditionally import or use different APIs depending on the installed Django version - Expose Django version information to templates for version-specific template logic - Simplify version-gated feature flags in reusable Django packages ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides version checking utilities for Django, allowing code to detect which Django version is installed and conditionally execute logic based on version comparisons. Yes, if you maintain Django code that must support multiple Django versions. It eliminates boilerplate version checking and is lightweight. No, if you target a single Django version or have already moved to modern Django—the library's last release was December 2022 and it does not yet declare support for Django versions beyond 4.1, so verify compatibility with your target version first. ## Install pip install django-nine uv add django-nine poetry add django-nine ## Installing django-nine Before you install: Low friction install with only Django and packaging as dependencies. Actively maintained as of April 2026, though last release was December 2022. License in practice: Dual-licensed under GPL-2.0-only or LGPL-2.1-or-later (copyleft). Use requires compliance with one of these licenses; derivative works must be released under compatible terms. Quickstart: pip install django-nine from django_nine import versions if versions.DJANGO_GTE_2_0: # Use Django 2.0+ API pass Requires Django 1.5 or later; Python 3.7 or later. Verify before relying: - Whether version constants are automatically generated or manually maintained as Django releases new versions - Performance impact of importing the library in hot code paths - Whether the package works with Django versions beyond 4.1 ## Package facts - License: GPL-2.0-only OR LGPL-2.1-or-later (copyleft) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 174.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django version checking, django compatibility detection, django version constants, conditional django logic by version, django version comparison, django compatibility utilities, django-compatibility, version-detection [View on SkillFed](https://skillfed.io/packages/django-nine) · [View on PyPI](https://pypi.org/project/django-nine/)