Require login by default
Some checks failed
Django CI/CD / test (push) Failing after 1m1s
Django CI/CD / build-and-push (push) Has been skipped

This commit is contained in:
2024-02-09 22:03:18 +01:00
parent d02a60675f
commit 081b8a92de
6 changed files with 52 additions and 1 deletions

View File

@ -67,6 +67,9 @@ if DEBUG:
DEBUG_TOOLBAR_CONFIG = {"ROOT_TAG_EXTRA_ATTRS": "hx-preserve"}
ROOT_URLCONF = "timetracker.urls"
LOGIN_URL = "/login/"
LOGIN_REDIRECT_URL = "/"
LOGOUT_REDIRECT_URL = "/login/"
TEMPLATES = [
{

View File

@ -15,6 +15,7 @@ Including another URLconf
"""
from django.conf import settings
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import RedirectView
@ -22,6 +23,8 @@ from graphene_django.views import GraphQLView
urlpatterns = [
path("", RedirectView.as_view(url="/tracker")),
path("login/", auth_views.LoginView.as_view(), name="login"),
path("logout/", auth_views.LogoutView.as_view(), name="logout"),
path("tracker/", include("games.urls")),
path("graphql", csrf_exempt(GraphQLView.as_view(graphiql=True))),
]