Metadata-Version: 2.4
Name: tms-django-api-version
Version: 1.0.1
Summary: Simple API endpoint for app versionning
Author-email: Franck COUTOULY <franck.coutouly@tms-software.ch>
License: MIT
Project-URL: Homepage, https://github.com/tms-software/django-api-version
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: Django
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: django>=4.2
Requires-Dist: djangorestframework>=3.14
Provides-Extra: dev
Requires-Dist: black>=24.0; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=4.0; extra == "dev"

# Django API Version

Simple api endpoint to display version from config

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

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

```python
from <project>.version import VERSION
```

And finally add the views in your urls

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

Then the version will be return on the corresponding endpoint.

