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 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)
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.
Profit
======
![Screenshot of django-health-check](http://c.kristian.io/image/3C2s1Z3X071S/Screen%20Shot%202013-03-18%20at%2018.40.52.png)
Our mascot
==========
![django-health-check is the most interresting project in the world](http://c.kristian.io/image/1J3x031Q0S3B/36347774.jpg)
Dependencies
============
Python 2.7+ (Yes, thats right, we have **Python 3 support**)
Django 1.2+
==================
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)
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.
Profit
======
![Screenshot of django-health-check](http://c.kristian.io/image/3C2s1Z3X071S/Screen%20Shot%202013-03-18%20at%2018.40.52.png)
Our mascot
==========
![django-health-check is the most interresting project in the world](http://c.kristian.io/image/1J3x031Q0S3B/36347774.jpg)
Dependencies
============
Python 2.7+ (Yes, thats right, we have **Python 3 support**)
Django 1.2+
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
File details
Details for the file django-health-check-0.3.tar.gz
.
File metadata
- Download URL: django-health-check-0.3.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 388588a0600220179fa2325d64bca58334e97ad5c07d749b14473c25216f8e3b |
|
MD5 | 92e3fb69102e2475a5ea48f3c055ff90 |
|
BLAKE2b-256 | 08328214bcdecde56098d441e6285b3e59971c3f29f2de2a2ab5e231cda3cf6a |