How to link html pages according to user URL input in Django?
A link for example: 127.0.0.1:8000/wiki/html I want to link to that HTML page where the user types a link, after ...wiki/name_of_page. The stored html pages are in "encyclopedia/name_of_page.html" So if I enter now: 127.0.0.1:8000/wiki/css it must load the "encyclopedia/css.html" page. I don't want to hardcode the url in the views.py in search function. So what is the way to link to the page according to user search. urls.py code is: from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), path("wiki/<str:search>", views.search, name="search") ] view.py code is: from django.shortcuts import render from . import util def index(request): return render(request, "encyclopedia/index.html", { "entries": util.list_entries() }) def search(request, search): return render(request, "encyclopedia/name_of_page.html", { # make the url changeable as per the need "search": search })