Skip to content

Commit

Permalink
Done
Browse files Browse the repository at this point in the history
  • Loading branch information
Stekloduv committed Sep 22, 2024
1 parent f749899 commit 1f4c569
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion taxi/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
path(
"drivers/<int:pk>/", DriverDetailView.as_view(), name="driver-detail"
),
path("registration/", include("django.contrib.auth.urls")),
]

app_name = "taxi"
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("registration/", include("django.contrib.auth.urls")),
path("accounts/", include("django.contrib.auth.urls")),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
4 changes: 2 additions & 2 deletions templates/includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
{% if user.is_authenticated %}
<a href="{% url "taxi:driver-detail" pk=user.id %}">User: {{user.username}}</a>
<br>
<a href="{% url 'taxi:logout' %}">Logout</a>
<a href="{% url 'logout' %}">Logout</a>
<br>
{% else %}
<a href="{% url 'taxi:login' %}">Login</a>
<a href="{% url 'login' %}">Login</a>
<br>
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion templates/registration/logged_out.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block content %}
<p>Logged out</p>
<form method="get" action="{% url 'taxi:login' %}">
<form method="get" action="{% url 'login' %}">
<button type="submit">Click here to log in again</button>
</form>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h1>Login</h1>
{% if form.errors %}
<p style="color: red">Invalid credentials</p>
{% endif %}
<form action="{% url 'taxi:login' %}" method="post">
<form action="{% url 'login' %}" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit">
Expand Down
2 changes: 1 addition & 1 deletion templates/taxi/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ <h2>Dynamic content</h2>
<li><strong>Drivers:</strong> {{ num_drivers }}</li>
<li><strong>Manufacturers:</strong> {{ num_manufacturers }}</li>
</ul>
<p>You have visited this page {{ num_visits }} time{{ num_visits|pluralize:"s" }}</p>
<p>You have visited this page {{ num_visits }} time{{ num_visits|pluralize }}</p>
{% endblock %}

0 comments on commit 1f4c569

Please sign in to comment.