django-nine
Version checking library.
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 on this page — 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
django-nine on PyPI
pip
pip install django-nineuv
uv add django-ninepoetry
poetry add django-nineInstalling 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 | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — Django, packaging |
| Maintenance | actively maintained — 1,348 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 174,191/month — #10,286 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_nine-0.2.7-py2.py3-none-any.whl
Keywords: django, compatibility
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
django-upgradeAutomatically modernizes Django project code by…
permissive · top 15,000 on PyPI
update_checkerChecks whether a whitelisted Python package has…
permissive · top 5,000 on PyPI
django-localflavorProvides country-specific form fields,…
permissive · top 5,000 on PyPI
numpy-typing-compatProvides version-specific type annotations for…
permissive · top 5,000 on PyPI
enum-compatConditionally installs enum34 on Python…
permissive · top 5,000 on PyPI
django-contrib-commentsProvides a Django framework for attaching…
permissive · top 15,000 on PyPI
django-waffleDjango Waffle provides feature flags (toggles)…
permissive · top 5,000 on PyPI
django-settings-exportProvides a Django template context processor…
permissive · top 15,000 on PyPI
django-jinjaIntegrates Jinja2 templating into Django,…
permissive · top 15,000 on PyPI