Skip to main content

Version checking library.

Project description

django-nine - version checking library for Django.

PyPI Version Supported Python versions Build Status GPL-2.0-only OR LGPL-2.1-or-later Coverage

Prerequisites

  • Python 2.6, 2.7, 3.4, 3.5, 3.6, 3.7 and 3.8.

  • Django 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 2.0, 2.1, 2.2 and 3.0.

Documentation

Documentation is available on Read the Docs.

Installation

Install latest stable version from PyPI:

pip install django-nine

Or latest stable version from GitHub:

pip install https://github.com/barseghyanartur/django-nine/archive/stable.zip

Or latest stable version from BitBucket:

pip install https://bitbucket.org/barseghyanartur/django-nine/get/stable.zip

Usage

Get Django versions

In code

For example, if Django version installed in your environment is 1.7.4, then the following would be true.

from django_nine import versions

versions.DJANGO_1_7  # True
versions.DJANGO_LTE_1_7  # True
versions.DJANGO_GTE_1_7  # True
versions.DJANGO_GTE_1_8  # False
versions.DJANGO_GTE_1_4  # True
versions.DJANGO_LTE_1_6  # False

In templates

With use of context processors

Add nine.context_processors.versions to your context processors.

TEMPLATES[0]['OPTIONS']['context_processors'] += \
    ['django_nine.context_processors.versions']

Or if you are using an old version of Django:

TEMPLATE_CONTEXT_PROCESSORS += ['django_nine.context_processors.versions']

Testing

Simply type:

./runtests.py

Or use tox:

tox

Or use tox to check specific env:

tox -e py37

Or run Django tests:

./manage.py test nine --settings=settings.testing

License

GPL-2.0-only OR LGPL-2.1-or-later

Support

For any issues contact me at the e-mail given in the Author section.

Author

Artur Barseghyan <artur.barseghyan@gmail.com>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-nine-0.2.3.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

django_nine-0.2.3-py2.py3-none-any.whl (25.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-nine-0.2.3.tar.gz.

File metadata

  • Download URL: django-nine-0.2.3.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for django-nine-0.2.3.tar.gz
Algorithm Hash digest
SHA256 f09fa5870ea2b0d86c03249c9c574c9b14c7e81b05dd860e9ef9c656740892cc
MD5 3671f91b1588005d47b7b3be9ab869fa
BLAKE2b-256 f0955e72ebeab14d93959e2654274260a82046642b2afc3185ff425f4e3913af

See more details on using hashes here.

Provenance

File details

Details for the file django_nine-0.2.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_nine-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 394c043668f820f50d1f7b27009b4957f9f480a7ecf74f55a6699b80ac6e1f69
MD5 173bfaef6c93b0adfec2ed5b43699037
BLAKE2b-256 58ac7bf4c7b08085bc81f915d8ff75e418ba55f593753e953743a632462f3496

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page