Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
endernaga committed Nov 8, 2023
1 parent 0a03c1f commit a7c91df
Show file tree
Hide file tree
Showing 6 changed files with 7 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("accounts/", include("django.contrib.auth.urls"))
]

app_name = "taxi"
2 changes: 1 addition & 1 deletion taxi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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 = {
Expand Down
1 change: 1 addition & 0 deletions taxi_service/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
urlpatterns = [
path("admin/", admin.site.urls),
path("", include("taxi.urls", namespace="taxi")),
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
@@ -1,9 +1,9 @@
<ul class="sidebar-nav">
{% if user.is_authenticated %}
<li>User: {{ user.username }}</li>
<li><a href="{% url 'taxi:logout' %}">Logout</a></li>
<li><a href="{% url 'logout' %}">Logout</a></li>
{% else %}
<li><a href="{% url 'taxi:login' %}">Login</a></li>
<li><a href="{% url 'login' %}">Login</a></li>
{% endif %}
<li><a href="{% url "taxi:index" %}">Home page</a></li>
<li><a href="{% url "taxi:manufacturer-list" %}">Manufacturers</a></li>
Expand Down
2 changes: 1 addition & 1 deletion templates/registration/logged_out.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

{% block content %}
<p>Logged out!</p>
<a href="{% url 'taxi:login'%}">Click here to login again.</a>
<a href="{% url 'login'%}">Click here to login again.</a>
{% endblock %}
4 changes: 2 additions & 2 deletions templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ <h1>Login</h1>
<p style="color: red">Invalid credentials</p>
{% endif %}

<form method="post" action="{% url 'taxi:login' %}">
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit">
</form>
{% endblock %}
{% endblock %}

0 comments on commit a7c91df

Please sign in to comment.