I am working on a Django project which has two views, home, and dashboard. I have a <div id="test">Hello</div>
in my home page. I have a link in the dashboard, which should take me to that specific #test
section on the home page. If I would have to just normally route to the home page, the link in my Django would look like: <a class="nav__link" href="{% url 'metrics:home' %}">Home</a>
. However, this wouldn’t take me to that specific section. How can I achieve this functionality?
urls.py
from . import views
from django.urls import path, include
app_name = 'metrics'
urlpatterns = [
path('', views.HomeView.as_view(), name='home'),
path('dashboard/', views.Dashboard.as_view(), name='dashboard'),
]