Skip to content

Instantly share code, notes, and snippets.

@micahhausler
Last active January 2, 2016 08:09
Show Gist options
  • Save micahhausler/8274935 to your computer and use it in GitHub Desktop.
Save micahhausler/8274935 to your computer and use it in GitHub Desktop.
Django heartbeat configuration for ELB Health Check
from django.http import HttpResponse
def HeartBeat(request):
"""
This method is for the AWS load balancer health check.
"""
return HttpResponse('{\'data\': {\'status\': \'healthy\'}}')
DEBUG = False
ALLOWED_HOSTS = [
'demo.ambition.io',
]
from django.conf.urls import patterns, include, url
from views import HeartBeat
urlpatterns = patterns(
# ...
url(r'^heartbeat/$', HeartBeat, name='ambition.heartbeat')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment