a pluggable app that runs a full check on the deployment, using a number of plugins to check e.g. database, queue server, celery processes, etc.
Project description
django-health-check
==================
[](https://pypi.python.org/pypi/django-health-check/)
[](https://travis-ci.org/KristianOellegaard/django-health-check)
[](https://coveralls.io/r/KristianOellegaard/django-health-check)
[](https://landscape.io/github/KristianOellegaard/django-health-check/master)
[](LICENSE)
This project checks a number of backends, if they are able to connect and do a simple action, e.g. check out the django ORM backend:
```python
class DjangoDatabaseBackend(BaseHealthCheckBackend):
def check_status(self):
try:
obj = TestModel.objects.create(title="test")
obj.title = "newtest"
obj.save()
obj.delete()
return True
except IntegrityError:
raise ServiceReturnedUnexpectedResult("Integrity Error")
except DatabaseError:
raise ServiceUnavailable("Database error")
```
The project is made using some of the same codes, that the django admin site uses - so when you have sucessfully written a new plugin, you register it to the pool, e.g.
```python
plugin_dir.register(DjangoDatabaseBackend)
```
Install
=======
Add this to urls.py
```python
url(r'^ht/', include('health_check.urls'))
```
Add required apps:
```python
'health_check',
'health_check_celery',
'health_check_db',
'health_check_cache',
'health_check_storage',
```
(remember to add dependencies, e.g. djcelery - however you should have that already, if you have celery running).
You'll also have to make sure that you have a
`result backend <http://celery.readthedocs.org/en/latest/configuration.html?highlight=result_backend#std:setting-CELERY_RESULT_BACKEND>`_
configured.
If you are using celery 3, use ``health_check_celery3`` instead of ``health_check_celery``.
Set up monitoring
=================
E.g. add to pingdom - django-health-check will return HTTP 200 if everything is OK and HTTP 500 if *anything* is not working.
Dependencies
============
Django 1.4+
==================
[](https://pypi.python.org/pypi/django-health-check/)
[](https://travis-ci.org/KristianOellegaard/django-health-check)
[](https://coveralls.io/r/KristianOellegaard/django-health-check)
[](https://landscape.io/github/KristianOellegaard/django-health-check/master)
[](LICENSE)
This project checks a number of backends, if they are able to connect and do a simple action, e.g. check out the django ORM backend:
```python
class DjangoDatabaseBackend(BaseHealthCheckBackend):
def check_status(self):
try:
obj = TestModel.objects.create(title="test")
obj.title = "newtest"
obj.save()
obj.delete()
return True
except IntegrityError:
raise ServiceReturnedUnexpectedResult("Integrity Error")
except DatabaseError:
raise ServiceUnavailable("Database error")
```
The project is made using some of the same codes, that the django admin site uses - so when you have sucessfully written a new plugin, you register it to the pool, e.g.
```python
plugin_dir.register(DjangoDatabaseBackend)
```
Install
=======
Add this to urls.py
```python
url(r'^ht/', include('health_check.urls'))
```
Add required apps:
```python
'health_check',
'health_check_celery',
'health_check_db',
'health_check_cache',
'health_check_storage',
```
(remember to add dependencies, e.g. djcelery - however you should have that already, if you have celery running).
You'll also have to make sure that you have a
`result backend <http://celery.readthedocs.org/en/latest/configuration.html?highlight=result_backend#std:setting-CELERY_RESULT_BACKEND>`_
configured.
If you are using celery 3, use ``health_check_celery3`` instead of ``health_check_celery``.
Set up monitoring
=================
E.g. add to pingdom - django-health-check will return HTTP 200 if everything is OK and HTTP 500 if *anything* is not working.
Dependencies
============
Django 1.4+
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-health-check-1.1.1.tar.gz.
File metadata
- Download URL: django-health-check-1.1.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d3265231ff8baa56d2173247b31ac22f622ecf3aead9fd28b174873c9f048c8
|
|
| MD5 |
a10ee76b822447bf37bc9238db1d4247
|
|
| BLAKE2b-256 |
029849cbd67adfadf23bb0aaa2990346672137dd1aeddaf925334e963828959f
|
File details
Details for the file django_health_check-1.1.1-py3-none-any.whl.
File metadata
- Download URL: django_health_check-1.1.1-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4052664855a03ae7785c45357559fe399284a45bddc51c9559feb565a58cb848
|
|
| MD5 |
4727385e6fd8894e6ae50225c7b5432d
|
|
| BLAKE2b-256 |
3a41c89495799e0807506f380c5329d212f6bceeba518975900ba802be037da2
|