Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup health check page in django

I have a webapp which required authentication to access any page of it. But for my ELB to work I have to setup health-check page for ELB so that ELB discover django app.

This page should return HTTP 200 and no auth required. How do I setup this with django/nginx world.

like image 467
Lahiru Avatar asked Oct 03 '15 08:10

Lahiru


1 Answers

You can use django-health-check 3rd party app.

Install it using pip -

pip install django-health-check 

Configue URL as -

urlpatterns = [
    # ...
    url(r'^health_check/', include('health_check.urls')),
]

and add the health_check applications to your INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    'health_check',                             # required
]

More details : https://github.com/KristianOellegaard/django-health-check

Now you can confiure ELB health check url as - /health_check/

like image 187
Aniket Thakur Avatar answered Sep 27 '22 18:09

Aniket Thakur