From 1f4c5695e220478afe4cbb97c550b57063abd78b Mon Sep 17 00:00:00 2001 From: Oleksandr Mykhailyk Date: Sun, 22 Sep 2024 20:09:10 +0200 Subject: [PATCH] Done --- taxi/urls.py | 1 - taxi_service/urls.py | 2 +- templates/includes/sidebar.html | 4 ++-- templates/registration/logged_out.html | 2 +- templates/registration/login.html | 2 +- templates/taxi/index.html | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/taxi/urls.py b/taxi/urls.py index e74e9899..bbb16a09 100644 --- a/taxi/urls.py +++ b/taxi/urls.py @@ -22,7 +22,6 @@ path( "drivers//", DriverDetailView.as_view(), name="driver-detail" ), - path("registration/", include("django.contrib.auth.urls")), ] app_name = "taxi" diff --git a/taxi_service/urls.py b/taxi_service/urls.py index 5f549026..baf83d1a 100644 --- a/taxi_service/urls.py +++ b/taxi_service/urls.py @@ -22,5 +22,5 @@ urlpatterns = [ path("admin/", admin.site.urls), path("", include("taxi.urls", namespace="taxi")), - path("registration/", include("django.contrib.auth.urls")), + path("accounts/", include("django.contrib.auth.urls")), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/templates/includes/sidebar.html b/templates/includes/sidebar.html index 8c1566ed..0ae795dc 100644 --- a/templates/includes/sidebar.html +++ b/templates/includes/sidebar.html @@ -2,10 +2,10 @@ {% if user.is_authenticated %} User: {{user.username}}
- Logout + Logout
{% else %} - Login + Login
{% endif %} diff --git a/templates/registration/logged_out.html b/templates/registration/logged_out.html index ba21550b..1f7546ea 100644 --- a/templates/registration/logged_out.html +++ b/templates/registration/logged_out.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %}

Logged out

-
+
{% endblock %} diff --git a/templates/registration/login.html b/templates/registration/login.html index 80e85b4b..d6f7bb8b 100644 --- a/templates/registration/login.html +++ b/templates/registration/login.html @@ -4,7 +4,7 @@

Login

{% if form.errors %}

Invalid credentials

{% endif %} -
+ {% csrf_token %} {{ form.as_p }} diff --git a/templates/taxi/index.html b/templates/taxi/index.html index 49c4477c..fd7d767c 100644 --- a/templates/taxi/index.html +++ b/templates/taxi/index.html @@ -10,5 +10,5 @@

Dynamic content

  • Drivers: {{ num_drivers }}
  • Manufacturers: {{ num_manufacturers }}
  • -

    You have visited this page {{ num_visits }} time{{ num_visits|pluralize:"s" }}

    +

    You have visited this page {{ num_visits }} time{{ num_visits|pluralize }}

    {% endblock %}