From 230b93ef5737f5b54f0b043521a2193e3030a92a Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Mon, 24 Jun 2019 17:04:26 +0800 Subject: [PATCH] Add django-health-check --- {{cookiecutter.project_slug}}/config/settings/base.py | 5 +++++ {{cookiecutter.project_slug}}/config/settings/production.py | 1 + {{cookiecutter.project_slug}}/config/urls.py | 1 + {{cookiecutter.project_slug}}/requirements/base.txt | 1 + 4 files changed, 8 insertions(+) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 4ffa50218..b1e05a284 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -75,8 +75,13 @@ THIRD_PARTY_APPS = [ "allauth.account", "allauth.socialaccount", "rest_framework", + "health_check", + "health_check.db", + "health_check.cache", + "health_check.storage", {%- if cookiecutter.use_celery == 'y' %} "django_celery_beat", + "health_check.contrib.celery", {%- endif %} ] diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index d838dc4ff..04bbea7c9 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -73,6 +73,7 @@ SECURE_CONTENT_TYPE_NOSNIFF = env.bool( INSTALLED_APPS += ["storages"] # noqa F405 {%- endif -%} {% if cookiecutter.cloud_provider == 'AWS' %} +INSTALLED_APPS += ["health_check.contrib.s3boto_storage"] # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings AWS_ACCESS_KEY_ID = env("DJANGO_AWS_ACCESS_KEY_ID") # https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings diff --git a/{{cookiecutter.project_slug}}/config/urls.py b/{{cookiecutter.project_slug}}/config/urls.py index 909d5e86e..583c87c3b 100644 --- a/{{cookiecutter.project_slug}}/config/urls.py +++ b/{{cookiecutter.project_slug}}/config/urls.py @@ -15,6 +15,7 @@ urlpatterns = [ # User management path("users/", include("{{ cookiecutter.project_slug }}.users.urls", namespace="users")), path("accounts/", include("allauth.urls")), + path("health/", include("health_check.urls")), # Your stuff: custom urls includes go here ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index f469aa928..6beea065f 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -24,6 +24,7 @@ django-environ==0.4.5 # https://github.com/joke2k/django-environ django-model-utils==3.1.2 # https://github.com/jazzband/django-model-utils django-allauth==0.39.1 # https://github.com/pennersr/django-allauth django-crispy-forms==1.7.2 # https://github.com/django-crispy-forms/django-crispy-forms +django-health-check==3.10.2 {%- if cookiecutter.use_compressor == "y" %} django-compressor==2.3 # https://github.com/django-compressor/django-compressor {%- endif %}