This commit updates common/djangoapps. These keys are now objects with a limited interface, and the particular internal representation is managed by the data storage layer (the modulestore). For the LMS, there should be no outward-facing changes to the system. The keys are, for now, a change to internal representation only. For Studio, the new serialized form of the keys is used in urls, to allow for further migration in the future. Co-Author: Andy Armstrong <andya@edx.org> Co-Author: Christina Roberts <christina@edx.org> Co-Author: David Baumgold <db@edx.org> Co-Author: Diana Huang <dkh@edx.org> Co-Author: Don Mitchell <dmitchell@edx.org> Co-Author: Julia Hansbrough <julia@edx.org> Co-Author: Nimisha Asthagiri <nasthagiri@edx.org> Co-Author: Sarina Canelake <sarina@edx.org> [LMS-2370]
19 lines
567 B
Python
19 lines
567 B
Python
import json
|
|
from datetime import datetime
|
|
from pytz import UTC
|
|
from django.http import HttpResponse
|
|
from xmodule.modulestore.django import modulestore
|
|
from dogapi import dog_stats_api
|
|
|
|
|
|
@dog_stats_api.timed('edxapp.heartbeat')
|
|
def heartbeat(request):
|
|
"""
|
|
Simple view that a loadbalancer can check to verify that the app is up
|
|
"""
|
|
output = {
|
|
'date': datetime.now(UTC).isoformat(),
|
|
'courses': [course.location.to_deprecated_string() for course in modulestore().get_courses()],
|
|
}
|
|
return HttpResponse(json.dumps(output, indent=4))
|