Compare commits

...

3 commits
main ... prod

Author SHA1 Message Date
Martin Pépin
8881cb2bf4
Merge branch 'master' into prod 2021-10-26 22:59:23 +02:00
Basile Clement
9556d9c562 Define HOST to "" to use unix domain socket connection 2021-04-10 20:04:23 +02:00
Théophile Bastian
437032ff23 Add /_health/ URL for monitoring purposes 2021-03-18 01:55:49 +01:00
2 changed files with 19 additions and 7 deletions

View file

@ -5,19 +5,22 @@ from allauth_ens.views import capture_login, capture_logout
from wiki.urls import get_pattern as get_wiki_pattern from wiki.urls import get_pattern as get_wiki_pattern
from django_nyt.urls import get_pattern as get_nyt_pattern from django_nyt.urls import get_pattern as get_nyt_pattern
from .views import HealthCheck
allauth_urls = [ allauth_urls = [
# Catch login/logout views of admin site. # Catch login/logout views of admin site.
url(r'^_admin/login/$', capture_login), url(r"^_admin/login/$", capture_login),
url(r'^_admin/logout/$', capture_logout), url(r"^_admin/logout/$", capture_logout),
# Allauth urls. # Allauth urls.
url(r'^_profil/', include('allauth.urls')), url(r"^_profil/", include("allauth.urls")),
] ]
urlpatterns = allauth_urls + [ urlpatterns = allauth_urls + [
url(r'^_admin/', admin.site.urls), url(r"^_admin/", admin.site.urls),
url(r'^notifications/', get_nyt_pattern()), url(r"^notifications/", get_nyt_pattern()),
url(r'^_groups/', include("wiki_groups.urls")), url(r"^_groups/", include("wiki_groups.urls")),
url(r'', get_wiki_pattern()), url(r"^_health/", HealthCheck.as_view()),
url(r"", get_wiki_pattern()),
] ]
# TODO add MEDIA_ROOT # TODO add MEDIA_ROOT

9
WikiENS/views.py Normal file
View file

@ -0,0 +1,9 @@
from django.http import HttpResponse
from django.views import View
class HealthCheck(View):
http_method_names = ["get", "head"]
def get(self, request, *args, **kwargs):
return HttpResponse("OK")