Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svisser/wsgiappversion
https://github.com/svisser/wsgiappversion
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/svisser/wsgiappversion
- Owner: svisser
- License: mit
- Created: 2014-10-06T10:19:21.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-09T14:52:33.000Z (about 10 years ago)
- Last Synced: 2024-10-10T21:44:35.855Z (26 days ago)
- Size: 102 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
wsgiappversion
==============What does it do?
----------------Adds a ``/version`` url that returns a json response of the current
application version.Example usage:
.. code-block:: python
from wsgiappversion import ApplicationVersion
from my_project import MyWSGIAppapplication = 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.