10 lines
386 B
Python
10 lines
386 B
Python
from django.http import HttpRequest, HttpResponse
|
|
|
|
|
|
def status(request: HttpRequest):
|
|
for accepted_type in request.accepted_types:
|
|
if accepted_type.is_all_types:
|
|
break
|
|
if accepted_type.match('application/json'):
|
|
return HttpResponse(b'{"status":"OK"}', content_type='application/json')
|
|
return HttpResponse('OK', content_type='text/plain')
|