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
==================
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 HealthCheckStatusType.working
except IntegrityError:
return HealthCheckStatusType.unexpected_result
except DatabaseError:
return HealthCheckStatusType.unavailable
```
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)
```
Installing
==========
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)
==================
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 HealthCheckStatusType.working
except IntegrityError:
return HealthCheckStatusType.unexpected_result
except DatabaseError:
return HealthCheckStatusType.unavailable
```
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)
```
Installing
==========
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)
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
Close
Hashes for django-health-check-0.1b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f46c5220b9613a590c6a6130f7ec156bb3612fafac992a9a728cf0c7e270b14f |
|
MD5 | ec4f05c6f85612ea97762e68c0be3a81 |
|
BLAKE2b-256 | b2e2dd62c8e4a3eb18b3fff0dddfc5f70669625d8e9b771ddf7d7890ab59984c |