Add heartbeat to cms

This commit is contained in:
Calen Pennington
2012-10-10 15:45:44 -04:00
parent 284f0d6a22
commit 5ae34aa4ed
4 changed files with 2 additions and 0 deletions

View File

@@ -1,5 +0,0 @@
from django.conf.urls import *
urlpatterns = patterns('',
url(r'^$', 'heartbeat.views.heartbeat', name='heartbeat'),
)

View File

@@ -1,15 +0,0 @@
import json
from datetime import datetime
from django.http import HttpResponse
from xmodule.modulestore.django import modulestore
def heartbeat(request):
"""
Simple view that a loadbalancer can check to verify that the app is up
"""
output = {
'date': datetime.now().isoformat(),
'courses': [course.location.url() for course in modulestore().get_courses()],
}
return HttpResponse(json.dumps(output, indent=4))