I have overridden the template url.html(template path: /admin/widgets/url.html) file of Django Admin. Now I need to keep that overridden file in my project folder so that whenever the functionality of url.html file is needed, the admin app should look into the overridden template(present inside the project folder) but not the template from Django Admin templates present inside the site-packages folder.
Here is my settings.py file settings for templates:
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [
os.path.join(BASE_DIR, "company", "app2"),
os.path.join(BASE_DIR, "company", "app2", "templates"),
],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
]
},
}
]
I have placed the overridden file in the following path in my project:
compnay -> app2 -> templates -> admin -> widgets -> url.html
url.html is present in the widgets folder. The changes made in the overridden template aren't being reflected in the Django Admin UI(For example, in the url.html file, I kept target="_blank" attribute inside the anchor tag to open the corresponding link in a new tab. These changes aren't being reflected.). So, I think it's not taking overridden template present inside my project.
What should I do to take the overridden url.html file present in my project folder?