Skip to main content

Simple API endpoint for app versionning

Project description

Django API Version

Simple api endpoint to display version from config

Create a version.py file containing the VERSION variable besides your settings.py

VERSION='0.0.1'
#You can also use an environment variable with the following
import os
VERSION=os.getenv('MY_VERSION', 'unknown')

Then import the version in your settings.py

from <project>.version import VERSION

And finally add the views in your urls

path(
    "version/",
    version_views.VersionView.as_view(),
    name="version",
)

Then the version will be return on the corresponding endpoint.

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

tms-django-api-version-1.0.0.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

tms_django_api_version-1.0.0-py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 3

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