Wsgi middleware that exposes an app's version number
Project description
Adds a /version url that returns a json response of the current application version.
Example usage:
from wsgiappversion import ApplicationVersion from my_project import MyWSGIApp application = MyWSGIApp() application = ApplicationVersion(application, determine_version='my_project')
The required determine_version argument is used to determine what the current version actually is. determine_version can be either a string or a callable that takes no arguments. When a string is used then the version is determined by calling pkg_resources.require(package_name). If that would not work for your application then a callable that returns the correct version can be used.
Since a package version would likely not change without an application restart we would recommend using a closure (or some other similar method of caching a value) as your callable.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wsgiappversion-1.0.0.tar.gz
.
File metadata
- Download URL: wsgiappversion-1.0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63f2549087264fedb8259f351da0d7189e52ef904c5877f82e9c6226eae5774e |
|
MD5 | 26b6f5ceff5b90c30b98af638f9ce7cd |
|
BLAKE2b-256 | 08619c8ca181ade35e27c4d2cd55b21fd9edea8ed2da6a6b378f47ffdaa387dc |
File details
Details for the file wsgiappversion-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: wsgiappversion-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ba7de0f6dc11b7625d24957bede2f527f3b66e957c5a79def87cb8a21f33940 |
|
MD5 | ecb6d503ce8cf0590bcb50c24ad8f124 |
|
BLAKE2b-256 | 353f4f006dd18e0f5a5eb4361d897cee6d9eea910020c2cfedbe93ab4d36213c |