Skip to main content

Travis Coveralls Requires License Version Supported Python version Supported Django version Package format Python wheel support Package status

django-project-version is a Django reusable app to show your project version

Installation

  • Obtain your copy of source code from the git repository: $ git clone https://github.com/DCOD-OpenSource/django-project-version.git. Or download the latest release from https://github.com/DCOD-OpenSource/django-project-version/tags/.

  • Run $ python ./setup.py install from the repository source tree or unpacked archive. Or use pip: $ pip install django-project-version.

Configuration

  • Add "djversion" to settings.INSTALLED_APPS.

# settings.py

INSTALLED_APPS += [
    "djversion",
]

Settings

DJVERSION_VERSION

Contains project version. Defaults to None.

DJVERSION_UPDATED

Contains project update date or datetime. Defaults to None.

DJVERSION_FORMAT_STRING

Contains version and updated format string. Defaults to "{version} ({updated})".

DJVERSION_GIT_REPO_PATH

Contains path to git repository from where version info can get. Defaults to None.

DJVERSION_GIT_USE_TAG

Indicate usage of git repository current tag as project version. Defaults to False.

DJVERSION_GIT_USE_COMMIT

Indicate usage of git repository last commit hash as project version. Defaults to False.

Usage

If you want always have "VERSION" variable in templates context, just add "djversion.context_processors.version" to settings.TEMPLATE_CONTEXT_PROCESSORS

# settings.py

TEMPLATE_CONTEXT_PROCESSORS += [
    "djversion.context_processors.version",
]

Or you can use project_version templatetag which can be loaded from djversion_tags.

{# footer.html #}

{% load djversion_tags %}

{% project_version as VERSION %}
{{ VERSION }}

Also simple management command print-version which prints project version to stdout is available. Just run: $ python ./manage.py print-version from project folder.

Advanced features

If you want to have REST-style view with your project version:

  • Install django-project-version with additional dependencies: $ pip install django-project-version[rest].

  • Extend you settings.INSTALLED_APPS by adding "rest_framework".

# settings.py

INSTALLED_APPS += [
    "rest_framework",
]
  • Add "djversion" to your URLs definitions:

# urls.py

from django.conf.urls import url


urlpatterns += [
    url(r"^version/", include("djversion.urls")),
]

Or to use information from the project git repository as project version:

  • Install django-project-version with additional dependencies: $ pip install django-project-version[git].

  • Configure git related settings.

Licensing

django-project-version uses the MIT license. Please check the MIT-LICENSE file for more details.

Contacts

Project Website: https://github.com/DCOD-OpenSource/django-project-version/

Author: DCOD <contact@d-cod.com>

For other authors list see AUTHORS file.

Release files for django-project-version 0.11.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-project-version 0.11.2
File Size Uploaded
django-project-version-0.11.2.zip 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-project-version 0.11.2
File Interpreter ABI Platform
django_project_version-0.11.2-py3-none-any.whl Python 3 none any Details

Total release size: 34.7 kB

Release files / django-project-version-0.11.2.zip

Download URL django-project-version-0.11.2.zip
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cb4efec848905430c99ef90bf525cf8743ec0c31842942f13265dd0477cdee6a
BLAKE2b-256 checksum
How to use checksums
328757e99fd2c748465d5d2b15be1e304e9cbaac45397b9c70670cf6b638b56b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release files / django_project_version-0.11.2-py3-none-any.whl

Download URL django_project_version-0.11.2-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb0468915c7d58278f38fe108b42c916313bb4f5802266610edb4431cfd8c03a
BLAKE2b-256 checksum
How to use checksums
5ebe81d3fa9ca4a09139d4430c6d5072f6748a5d1dd6f6e6fe9c3a7b0d90f922
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release history Release notifications | RSS feed

0.18.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.9

2 release files

0.14.8

2 release files

0.14.7

2 release files

0.14.5

2 release files

0.14.4

2 release files

0.14.3

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

This release

0.11.2 This release

2 release files

0.10.9

2 release files

0.10.8

2 release files

0.10.7

2 release files

0.10.6

2 release files

0.10.5

2 release files

0.10.4

2 release files

0.10.0

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page