django-project-version


Namedjango-project-version JSON
Version 0.14.9 PyPI version JSON
download
home_pagehttps://github.com/DCOD-OpenSource/django-project-version/
SummaryDjango reusable app to show your project version
upload_time2021-03-16 01:26:15
maintainer
docs_urlhttps://pythonhosted.org/django-project-version/
authorDCOD
requires_python
licenseMIT
keywords django version project django-project-version
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. django-project-version
.. README.rst


A django-project-version documentation
======================================

|GitHub|_ |Coveralls|_ |Requires|_ |pypi-license|_ |pypi-version|_ |pypi-python-version|_ |pypi-django-version|_ |pypi-format|_ |pypi-wheel|_ |pypi-status|_

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

.. contents::

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``.

.. code-block:: python

    # 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``

.. code-block:: python

    # settings.py

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


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

.. code-block:: django

    {# 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"``.

.. code-block:: python

    # settings.py

    INSTALLED_APPS += [
        "rest_framework",
    ]

* Add ``"djversion"`` to your URLs definitions:

.. code-block:: python

    # urls.py

    from django.urls import re_path, include


    urlpatterns += [
        re_path(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.


.. |GitHub| image:: https://github.com/DCOD-OpenSource/django-project-version/workflows/build/badge.svg
    :alt: GitHub
.. |Coveralls| image:: https://coveralls.io/repos/github/DCOD-OpenSource/django-project-version/badge.svg?branch=master
    :alt: Coveralls
.. |Requires| image:: https://requires.io/github/DCOD-OpenSource/django-project-version/requirements.svg?branch=master
    :alt: Requires
.. |pypi-license| image:: https://img.shields.io/pypi/l/django-project-version
    :alt: License
.. |pypi-version| image:: https://img.shields.io/pypi/v/django-project-version
    :alt: Version
.. |pypi-django-version| image:: https://img.shields.io/pypi/djversions/django-project-version
    :alt: Supported Django version
.. |pypi-python-version| image:: https://img.shields.io/pypi/pyversions/django-project-version
    :alt: Supported Python version
.. |pypi-format| image:: https://img.shields.io/pypi/format/django-project-version
    :alt: Package format
.. |pypi-wheel| image:: https://img.shields.io/pypi/wheel/django-project-version
    :alt: Python wheel support
.. |pypi-status| image:: https://img.shields.io/pypi/status/django-project-version
    :alt: Package status
.. _GitHub: https://github.com/DCOD-OpenSource/django-project-version/actions/
.. _Coveralls: https://coveralls.io/github/DCOD-OpenSource/django-project-version?branch=master
.. _Requires: https://requires.io/github/DCOD-OpenSource/django-project-version/requirements/?branch=master
.. _pypi-license: https://pypi.org/project/django-project-version/
.. _pypi-version: https://pypi.org/project/django-project-version/
.. _pypi-django-version: https://pypi.org/project/django-project-version/
.. _pypi-python-version: https://pypi.org/project/django-project-version/
.. _pypi-format: https://pypi.org/project/django-project-version/
.. _pypi-wheel: https://pypi.org/project/django-project-version/
.. _pypi-status: https://pypi.org/project/django-project-version/



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DCOD-OpenSource/django-project-version/",
    "name": "django-project-version",
    "maintainer": "",
    "docs_url": "https://pythonhosted.org/django-project-version/",
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django,version,project,django-project-version",
    "author": "DCOD",
    "author_email": "contact@d-cod.com",
    "download_url": "https://files.pythonhosted.org/packages/96/39/19c2c8a4c06aa6949e1165d7128e7fcd103ea8c4f234b4875af4afd5764c/django-project-version-0.14.9.zip",
    "platform": "",
    "description": ".. django-project-version\n.. README.rst\n\n\nA django-project-version documentation\n======================================\n\n|GitHub|_ |Coveralls|_ |Requires|_ |pypi-license|_ |pypi-version|_ |pypi-python-version|_ |pypi-django-version|_ |pypi-format|_ |pypi-wheel|_ |pypi-status|_\n\n    *django-project-version is a Django reusable app to show your project version*\n\n.. contents::\n\nInstallation\n------------\n* 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/.\n* Run ``$ python ./setup.py install`` from the repository source tree or unpacked archive. Or use pip: ``$ pip install django-project-version``.\n\nConfiguration\n-------------\n* Add ``\"djversion\"`` to ``settings.INSTALLED_APPS``.\n\n.. code-block:: python\n\n    # settings.py\n\n    INSTALLED_APPS += [\n        \"djversion\",\n    ]\n\nSettings\n--------\n``DJVERSION_VERSION``\n    Contains project version. Defaults to ``None``.\n\n``DJVERSION_UPDATED``\n    Contains project update date or datetime. Defaults to ``None``.\n\n``DJVERSION_FORMAT_STRING``\n    Contains version and updated format string. Defaults to ``\"{version} ({updated})\"``.\n\n``DJVERSION_GIT_REPO_PATH``\n    Contains path to git repository from where version info can get. Defaults to ``None``.\n\n``DJVERSION_GIT_USE_TAG``\n    Indicate usage of git repository current tag as project version. Defaults to ``False``.\n\n``DJVERSION_GIT_USE_COMMIT``\n    Indicate usage of git repository last commit hash as project version. Defaults to ``False``.\n\nUsage\n-----\nIf you want always have ``\"VERSION\"`` variable in templates context, just add ``\"djversion.context_processors.version\"`` to ``settings.TEMPLATE_CONTEXT_PROCESSORS``\n\n.. code-block:: python\n\n    # settings.py\n\n    TEMPLATE_CONTEXT_PROCESSORS += [\n        \"djversion.context_processors.version\",\n    ]\n\n\nOr you can use ``project_version`` templatetag which can be loaded from ``djversion_tags``.\n\n.. code-block:: django\n\n    {# footer.html #}\n\n    {% load djversion_tags %}\n\n    {% project_version as VERSION %}\n    {{ VERSION }}\n\nAlso simple management command ``print-version`` which prints project version to stdout is available. Just run: ``$ python ./manage.py print-version`` from project folder.\n\nAdvanced features\n-----------------\nIf you want to have REST-style view with your project version:\n\n* Install ``django-project-version`` with additional dependencies: ``$ pip install django-project-version[rest]``.\n* Extend you ``settings.INSTALLED_APPS`` by adding ``\"rest_framework\"``.\n\n.. code-block:: python\n\n    # settings.py\n\n    INSTALLED_APPS += [\n        \"rest_framework\",\n    ]\n\n* Add ``\"djversion\"`` to your URLs definitions:\n\n.. code-block:: python\n\n    # urls.py\n\n    from django.urls import re_path, include\n\n\n    urlpatterns += [\n        re_path(r\"^version/\", include(\"djversion.urls\")),\n    ]\n\nOr to use information from the project git repository as project version:\n\n* Install ``django-project-version`` with additional dependencies: ``$ pip install django-project-version[git]``.\n* Configure git related settings.\n\nLicensing\n---------\ndjango-project-version uses the MIT license. Please check the MIT-LICENSE file for more details.\n\nContacts\n--------\n**Project Website**: https://github.com/DCOD-OpenSource/django-project-version/\n\n**Author**: DCOD <contact@d-cod.com>\n\nFor other authors list see AUTHORS file.\n\n\n.. |GitHub| image:: https://github.com/DCOD-OpenSource/django-project-version/workflows/build/badge.svg\n    :alt: GitHub\n.. |Coveralls| image:: https://coveralls.io/repos/github/DCOD-OpenSource/django-project-version/badge.svg?branch=master\n    :alt: Coveralls\n.. |Requires| image:: https://requires.io/github/DCOD-OpenSource/django-project-version/requirements.svg?branch=master\n    :alt: Requires\n.. |pypi-license| image:: https://img.shields.io/pypi/l/django-project-version\n    :alt: License\n.. |pypi-version| image:: https://img.shields.io/pypi/v/django-project-version\n    :alt: Version\n.. |pypi-django-version| image:: https://img.shields.io/pypi/djversions/django-project-version\n    :alt: Supported Django version\n.. |pypi-python-version| image:: https://img.shields.io/pypi/pyversions/django-project-version\n    :alt: Supported Python version\n.. |pypi-format| image:: https://img.shields.io/pypi/format/django-project-version\n    :alt: Package format\n.. |pypi-wheel| image:: https://img.shields.io/pypi/wheel/django-project-version\n    :alt: Python wheel support\n.. |pypi-status| image:: https://img.shields.io/pypi/status/django-project-version\n    :alt: Package status\n.. _GitHub: https://github.com/DCOD-OpenSource/django-project-version/actions/\n.. _Coveralls: https://coveralls.io/github/DCOD-OpenSource/django-project-version?branch=master\n.. _Requires: https://requires.io/github/DCOD-OpenSource/django-project-version/requirements/?branch=master\n.. _pypi-license: https://pypi.org/project/django-project-version/\n.. _pypi-version: https://pypi.org/project/django-project-version/\n.. _pypi-django-version: https://pypi.org/project/django-project-version/\n.. _pypi-python-version: https://pypi.org/project/django-project-version/\n.. _pypi-format: https://pypi.org/project/django-project-version/\n.. _pypi-wheel: https://pypi.org/project/django-project-version/\n.. _pypi-status: https://pypi.org/project/django-project-version/\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Django reusable app to show your project version",
    "version": "0.14.9",
    "split_keywords": [
        "django",
        "version",
        "project",
        "django-project-version"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "4495daf5f852351a32a90d24f33a9937",
                "sha256": "c703d7bf767324abacee94058775623d1800378b3579d5e230af0d6ad2121aff"
            },
            "downloads": -1,
            "filename": "django_project_version-0.14.9-py3-none-any.whl",
            "has_sig": true,
            "md5_digest": "4495daf5f852351a32a90d24f33a9937",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 12855,
            "upload_time": "2021-03-16T01:26:13",
            "upload_time_iso_8601": "2021-03-16T01:26:13.328605Z",
            "url": "https://files.pythonhosted.org/packages/e0/d2/8837ec69a6b4e77cba118355877417336662ff8e96383c96ac8b2c5f627e/django_project_version-0.14.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "8e2aa3b99f3858c469b159e9ce1f2893",
                "sha256": "4ec83cd80e831db81ddbee08d0ec76fd7df1f49e4f216687b861eadbd30f3c8c"
            },
            "downloads": -1,
            "filename": "django-project-version-0.14.9.zip",
            "has_sig": true,
            "md5_digest": "8e2aa3b99f3858c469b159e9ce1f2893",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 23870,
            "upload_time": "2021-03-16T01:26:15",
            "upload_time_iso_8601": "2021-03-16T01:26:15.145527Z",
            "url": "https://files.pythonhosted.org/packages/96/39/19c2c8a4c06aa6949e1165d7128e7fcd103ea8c4f234b4875af4afd5764c/django-project-version-0.14.9.zip",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-03-16 01:26:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "DCOD-OpenSource",
    "error": "Could not fetch GitHub repository",
    "lcname": "django-project-version"
}
        
Elapsed time: 0.30215s