Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Bondzik-S committed Nov 19, 2024
1 parent c9cb6a2 commit 9785b2e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion taxi_service/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@
"127.0.0.1",
]

LOGIN_REDIRECT_URL = "/" # Перенаправляє на головну сторінку після входу
LOGIN_REDIRECT_URL = "/"
5 changes: 5 additions & 0 deletions taxi_service/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path("blog/", include("blog.urls"))
"""
from debug_toolbar.toolbar import debug_toolbar_urls
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
Expand All @@ -24,3 +25,7 @@
path("", include("taxi.urls", namespace="taxi")),
path("accounts/", include("django.contrib.auth.urls"))
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

if settings.DEBUG:
import debug_toolbar
urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]
22 changes: 12 additions & 10 deletions templates/includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<ul class="sidebar-nav">
{% if user.is_authenticated %}
<p>User: {{ user.username }}</p>
<a href="{% url "logout" %}">Logout</a>
{# <p>User: {{ user.username }}</p>#}
<a href="{% url 'taxi:driver-detail' user.pk %}">User: {{ user.first_name }} {{ user.last_name }}</a>
<br>
<a href="{% url 'logout' %}">Logout</a>
<hr>
{% else %}
<a href="{% url "login" %}">Login</a>
<hr>
{% endif %}
<li><a href="{% url "taxi:index" %}">Home page</a></li>
<li><a href="{% url "taxi:manufacturer-list" %}">Manufacturers</a></li>
<li><a href="{% url "taxi:car-list" %}">Cars</a></li>
<li><a href="{% url "taxi:driver-list" %}">Drivers</a></li>
{% else %}
<a href="{% url 'login' %}">Login</a>
<hr>
{% endif %}
<li><a href="{% url 'taxi:index' %}">Home page</a></li>
<li><a href="{% url 'taxi:manufacturer-list' %}">Manufacturers</a></li>
<li><a href="{% url 'taxi:car-list' %}">Cars</a></li>
<li><a href="{% url 'taxi:driver-list' %}">Drivers</a></li>
</ul>
File renamed without changes.

0 comments on commit 9785b2e

Please sign in to comment.