diff --git a/apps/health/__init__.py b/apps/health/__init__.py new file mode 100644 index 0000000..dae354a --- /dev/null +++ b/apps/health/__init__.py @@ -0,0 +1 @@ +# -*- encoding: utf-8 -*- diff --git a/apps/health/admin.py b/apps/health/admin.py new file mode 100644 index 0000000..5cde6b2 --- /dev/null +++ b/apps/health/admin.py @@ -0,0 +1,3 @@ +# -*- encoding: utf-8 -*- + +from django.contrib import admin diff --git a/apps/health/config.py b/apps/health/config.py new file mode 100644 index 0000000..a8e32cc --- /dev/null +++ b/apps/health/config.py @@ -0,0 +1,8 @@ +# -*- encoding: utf-8 -*- + +from django.apps import AppConfig + + +class HealthConfig(AppConfig): + name = 'apps.health' + label = 'apps_health' diff --git a/apps/health/migrations/__init__.py b/apps/health/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/health/models.py b/apps/health/models.py new file mode 100644 index 0000000..e626e05 --- /dev/null +++ b/apps/health/models.py @@ -0,0 +1,3 @@ +# -*- encoding: utf-8 -*- + +from django.db import models diff --git a/apps/health/tests.py b/apps/health/tests.py new file mode 100644 index 0000000..59631c2 --- /dev/null +++ b/apps/health/tests.py @@ -0,0 +1,3 @@ +# -*- encoding: utf-8 -*- + +from django.test import TestCase diff --git a/apps/health/urls.py b/apps/health/urls.py new file mode 100644 index 0000000..c4e251f --- /dev/null +++ b/apps/health/urls.py @@ -0,0 +1,9 @@ +# -*- encoding: utf-8 -*- + +from django.urls import path + +from .views import HealthCheck + +urlpatterns = [ + path("", HealthCheck.as_view(), name="check"), +] diff --git a/apps/health/views.py b/apps/health/views.py new file mode 100644 index 0000000..31a4d5e --- /dev/null +++ b/apps/health/views.py @@ -0,0 +1,9 @@ +# -*- encoding: utf-8 -*- + +from django.http import HttpResponse +from django.views.generic import View + + +class HealthCheck(View): + def get(self, request, *args, **kwargs): + return HttpResponse("healthy") diff --git a/core/settings.py b/core/settings.py index cd2771f..f31c69b 100644 --- a/core/settings.py +++ b/core/settings.py @@ -36,7 +36,8 @@ INSTALLED_APPS = [ "django_filters", 'apps.api', 'apps.home', - 'apps.authentication' + 'apps.authentication', + "apps.health" ] MIDDLEWARE = [ diff --git a/core/urls.py b/core/urls.py index 5a1c7bb..41fc536 100644 --- a/core/urls.py +++ b/core/urls.py @@ -8,6 +8,7 @@ from django.urls import path, include # add this urlpatterns = [ path('admin/', admin.site.urls), path("api/", include(("apps.api.urls", "apps.api"), namespace="api")), + path("health/", include(("apps.health.urls", "apps.health"), namespace="health")), # ADD NEW Routes HERE *static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT),