Resource health checks for Django.
Project description
Django Canary Endpoint
======================
Provides [canary endpoints](http://byterot.blogspot.com/2014/11/health-endpoint-in-api-design-slippery-rest-api-design-canary-endpoint-hysterix-asp-net-web-api.html)
for common Django dependencies.
### Installation
pip install django-canary-endpoint
### Quickstart
```python
# Canary
########
from canary_endpoint import GitCanary
from canary_endpoint.resources.databases import DjangoDatabase
from canary_endpoint.resources.rq import DjangoRQ
from canary_endpoint.resources.services import Service, ServiceWithCanary
canary = GitCanary('example', root=ROOT, version=VERSION, resources=[
DjangoDatabase(statements=['SELECT 1 FROM foo LIMIT 1']),
DjangoRQ(),
Service('foo', url=HTTP_ENDPOINT),
ServiceWithCanary('bar', url=HTTP_ENDPOINT_WITH_CANARY),
])
# URLs
######
from canary_endpoint.views import status
from django.conf.urls import patterns, url
urlpatterns = patterns('', url(r'^_status/$', status, {'canary': canary}))
```
See the [example project](./tests/projects/example.py) for full configuration.
Also see the [example response data](./tests/fixtures/ok.json).
### Testing
make test
open coverage/index.html
For more thorough multi-Django version testing, (`arc lint` will not run this)
use:
tox
### License
The MIT License (MIT)
Copyright 2015 ATX Innovations
======================
Provides [canary endpoints](http://byterot.blogspot.com/2014/11/health-endpoint-in-api-design-slippery-rest-api-design-canary-endpoint-hysterix-asp-net-web-api.html)
for common Django dependencies.
### Installation
pip install django-canary-endpoint
### Quickstart
```python
# Canary
########
from canary_endpoint import GitCanary
from canary_endpoint.resources.databases import DjangoDatabase
from canary_endpoint.resources.rq import DjangoRQ
from canary_endpoint.resources.services import Service, ServiceWithCanary
canary = GitCanary('example', root=ROOT, version=VERSION, resources=[
DjangoDatabase(statements=['SELECT 1 FROM foo LIMIT 1']),
DjangoRQ(),
Service('foo', url=HTTP_ENDPOINT),
ServiceWithCanary('bar', url=HTTP_ENDPOINT_WITH_CANARY),
])
# URLs
######
from canary_endpoint.views import status
from django.conf.urls import patterns, url
urlpatterns = patterns('', url(r'^_status/$', status, {'canary': canary}))
```
See the [example project](./tests/projects/example.py) for full configuration.
Also see the [example response data](./tests/fixtures/ok.json).
### Testing
make test
open coverage/index.html
For more thorough multi-Django version testing, (`arc lint` will not run this)
use:
tox
### License
The MIT License (MIT)
Copyright 2015 ATX Innovations
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
Close
Hashes for django-canary-endpoint-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f33639eadf3e4577aa75864f0bafceed4d437d4c8474346326c13de8a5b6f2f6 |
|
MD5 | 80d912e7b82149b67afe9cb355659dc8 |
|
BLAKE2b-256 | 686b8d751ead5915227495d0776385133f7d470e28ba6186bf82dbec2518c5dd |