2020-05-17 21:34:43 +02:00
|
|
|
from django.contrib.auth.decorators import login_required
|
|
|
|
from django.http import HttpResponse
|
2020-05-17 17:36:15 +02:00
|
|
|
from django.urls import include, path
|
|
|
|
|
2020-05-17 21:34:43 +02:00
|
|
|
# ---
|
|
|
|
# Two tiny views to easily test user authentication.
|
|
|
|
# ---
|
|
|
|
|
2020-07-18 18:08:43 +02:00
|
|
|
|
2020-05-17 21:34:43 +02:00
|
|
|
def public_view(request):
|
|
|
|
return HttpResponse("OK")
|
|
|
|
|
|
|
|
|
|
|
|
@login_required
|
|
|
|
def private_view(request):
|
|
|
|
return HttpResponse("OK")
|
|
|
|
|
|
|
|
|
|
|
|
# ---
|
|
|
|
# Urls: expose authens' urls + the above views.
|
|
|
|
# ---
|
|
|
|
|
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
path("public", public_view),
|
|
|
|
path("private", private_view),
|
|
|
|
path("authens/", include("authens.urls")),
|
|
|
|
]
|