Hi there,
When we login to Django Admin Interface as a superuser, we see the list of models on the left sidebar. When we click on any model name, we go to the list display page of that model which have 'Add [Model-Name]" button on uuper right corner. How do I change the text/value of that button? In my case, I have User
Model, and I want to change the “Add User” text on list display page of User
Model to “Invite User”. How do I accomplish that? I have encircled the button with red in the screenshot attached.
I have tried different solutions told in this stackoverflow question and in this django documentation. But I am unable to achieve. I tried to override change_form.html
by changing {% blocktranslate with name=opts.verbose_name %}Add {{ name }}{% endblocktranslate %}
to {% blocktranslate with name=opts.verbose_name %}Invite {{ name }}{% endblocktranslate %}
. I put the overriden file change_form.html
in pricingmeister/accounts/templates/admin/
. But i could not see the change.
The hierarchy of my Django Project and folders is below:
Below is my settings.py
(truncated some code to show only relevant part of code
.
.
.
INSTALLED_APPS = [
# Local Apps
"pricingmeister.accounts",
"pricingmeister.core",
# Django Apps
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
]
.
.
.
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"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",
],
},
},
]
.
.
.
What wrong am I doing? Any help will be appreciated.