From 813e43239920dee76485728ac3710c2f8d4c4666 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 25 Jan 2022 00:03:52 -0500 Subject: [PATCH] Use `{% url %}` instead of hard-coded urls --- recmaint/urls.py | 2 +- rentals/templates/rentals/lockers.dj.html | 2 +- tasks/templates/tasks/taskDetail.dj.html | 5 ++++- tasks/templates/tasks/toolDetail.dj.html | 5 ++++- templates/base.dj.html | 10 +++++----- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/recmaint/urls.py b/recmaint/urls.py index 4803d59..c5ded1a 100644 --- a/recmaint/urls.py +++ b/recmaint/urls.py @@ -20,7 +20,7 @@ from django.contrib.auth.views import LoginView, LogoutView urlpatterns = [ - path("", lambda request: redirect("/tasks/")), + path("", lambda request: redirect("/tasks/"), name="root"), path("tasks/", include("tasks.urls")), path("rentals/", include("rentals.urls")), path("admin/", admin.site.urls), diff --git a/rentals/templates/rentals/lockers.dj.html b/rentals/templates/rentals/lockers.dj.html index 86f9929..89b6248 100644 --- a/rentals/templates/rentals/lockers.dj.html +++ b/rentals/templates/rentals/lockers.dj.html @@ -1,7 +1,7 @@ {% extends "base.dj.html" %} {% block title %}Lockers Index{% endblock %} -{% block admin_link %}/admin/rentals/{% endblock %} +{% block admin_link %}{% url 'admin:app_list' 'rentals' %}{% endblock %} {% block content %}