Skip to content

Commit

Permalink
implemented authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
S-SMTN committed Nov 23, 2023
1 parent 83db015 commit 9a76894
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions taxi_service/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@

AUTH_USER_MODEL = "taxi.Driver"

LOGIN_REDIRECT_URL = "/cars/"

# Internationalization
# https://docs.djangoproject.com/en/4.0/topics/i18n/

Expand Down
2 changes: 1 addition & 1 deletion templates/includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ul class="sidebar-nav">
{% if user.is_authenticated %}
<li>User: <a href="{% url "taxi:driver-detail" pk=user.id %}">{{ user.username }}</a></li>
<li>User: <a href="{% url 'taxi:driver-detail' pk=user.id %}">{{ user.username }}</a></li>
<li><a href="{% url 'logout' %}">Logout</a></li>
{% else %}
<li><a href="{% url 'login' %}">Login</a></li>
Expand Down

0 comments on commit 9a76894

Please sign in to comment.