Healthcheck app

This commit is contained in:
Corban-Lee Jones 2024-02-11 23:53:51 +00:00
parent 404aa3680f
commit 48c4a725a4
10 changed files with 39 additions and 1 deletions

1
apps/health/__init__.py Normal file
View File

@ -0,0 +1 @@
# -*- encoding: utf-8 -*-

3
apps/health/admin.py Normal file
View File

@ -0,0 +1,3 @@
# -*- encoding: utf-8 -*-
from django.contrib import admin

8
apps/health/config.py Normal file
View File

@ -0,0 +1,8 @@
# -*- encoding: utf-8 -*-
from django.apps import AppConfig
class HealthConfig(AppConfig):
name = 'apps.health'
label = 'apps_health'

View File

3
apps/health/models.py Normal file
View File

@ -0,0 +1,3 @@
# -*- encoding: utf-8 -*-
from django.db import models

3
apps/health/tests.py Normal file
View File

@ -0,0 +1,3 @@
# -*- encoding: utf-8 -*-
from django.test import TestCase

9
apps/health/urls.py Normal file
View File

@ -0,0 +1,9 @@
# -*- encoding: utf-8 -*-
from django.urls import path
from .views import HealthCheck
urlpatterns = [
path("", HealthCheck.as_view(), name="check"),
]

9
apps/health/views.py Normal file
View File

@ -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")

View File

@ -36,7 +36,8 @@ INSTALLED_APPS = [
"django_filters",
'apps.api',
'apps.home',
'apps.authentication'
'apps.authentication',
"apps.health"
]
MIDDLEWARE = [

View File

@ -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),