Skip to content

Commit

Permalink
Solution 2
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiIshchenko committed Nov 17, 2023
1 parent ec11098 commit 5834469
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file modified db.sqlite3
Binary file not shown.
4 changes: 3 additions & 1 deletion taxi/views.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions taxi_service/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5834469

Please sign in to comment.