diff --git a/db.sqlite3 b/db.sqlite3 index b5936340..3f1524c2 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/taxi/views.py b/taxi/views.py index 6e86b58c..fbd0be56 100644 --- a/taxi/views.py +++ b/taxi/views.py @@ -1,3 +1,4 @@ +from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpRequest, HttpResponse from django.shortcuts import render @@ -6,7 +7,8 @@ from .models import Driver, Car, Manufacturer -def index(request: HttpRequest) -> HttpResponse: +@login_required +def index(request: HttpRequest) -> HttpResponse: """View function for the home page of the site.""" num_drivers = Driver.objects.count() diff --git a/taxi_service/settings.py b/taxi_service/settings.py index 4706af52..a4ef2fd3 100644 --- a/taxi_service/settings.py +++ b/taxi_service/settings.py @@ -12,8 +12,6 @@ from pathlib import Path -from django.conf.global_settings import LOGIN_REDIRECT_URL - # Build paths inside the project like this: BASE_DIR / "subdir". BASE_DIR = Path(__file__).resolve().parent.parent