Skip to content

Commit

Permalink
Solution ready to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-Shakhman committed Sep 16, 2024
1 parent 041127d commit cdf3c5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion taxi/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.urls import path, include
from django.urls import path

from .views import (
index,
Expand Down
4 changes: 2 additions & 2 deletions taxi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def index(request):
num_drivers = Driver.objects.count()
num_cars = Car.objects.count()
num_manufacturers = Manufacturer.objects.count()
num_visits = request.session.get("num_visits", 0)
num_visits = request.session.get("num_visits", 1)
request.session["num_visits"] = num_visits + 1

context = {
"num_drivers": num_drivers,
"num_cars": num_cars,
"num_manufacturers": num_manufacturers,
"num_visits": num_visits + 1,
"num_visits": num_visits,
}

return render(request, "taxi/index.html", context=context)
Expand Down
2 changes: 1 addition & 1 deletion taxi_service/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
urlpatterns = [
path("admin/", admin.site.urls),
path("", include("taxi.urls", namespace="taxi")),
path("account/", include("django.contrib.auth.urls"), name="login"),
path("account/", include("django.contrib.auth.urls")),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

0 comments on commit cdf3c5d

Please sign in to comment.