From 08ae07b1b02367c218fa71b62670e6a47dad1764 Mon Sep 17 00:00:00 2001 From: Alec Clowes Date: Tue, 29 Aug 2017 21:33:26 -0700 Subject: [PATCH] add healthcheck api --- setup.py | 2 +- yawn/settings/base.py | 1 + yawn/urls.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 177d823..a7d4e32 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.1.5', + version='0.1.6', description='Yet Another Workflow Engine, a subprocess-based DAG execution system', long_description=long_description, diff --git a/yawn/settings/base.py b/yawn/settings/base.py index 3dfe361..5f5e262 100644 --- a/yawn/settings/base.py +++ b/yawn/settings/base.py @@ -11,6 +11,7 @@ # Tell Django that it is running behind a proxy and should forward HTTP->HTTPS SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') SECURE_SSL_REDIRECT = True +SECURE_REDIRECT_EXEMPT = ['^api/healthy/$'] # Custom YAWN settings diff --git a/yawn/urls.py b/yawn/urls.py index 58623d2..e6fb125 100644 --- a/yawn/urls.py +++ b/yawn/urls.py @@ -1,4 +1,5 @@ from django.conf.urls import include, url +from django.http import HttpResponse from rest_framework import routers from yawn.task.views import TaskViewSet, ExecutionViewSet @@ -21,5 +22,5 @@ # Additionally, we include login URLs for the browsable API. urlpatterns = [ url(r'^api/', include(router.urls)), - url(r'^api-auth/', include('rest_framework.urls')) + url(r'^api/healthy/$', lambda x: HttpResponse('ok')), ]