Removing django admin panel content

algorithm: pbkdf2_sha256 iterations: 216000 salt: 7WW1Fr****** hash: dqMnCG************************************** Raw passwords are not stored, so there is no way to see this user’s password, but you can change the password using this form. how can i remove this portion or hide this

i couldn't get the solution from any where

Create a template in your project templates/admin/auth/user/change_form.html, then copy the original content of the template from Django. Edit and remove sections

In your forms.py, We can use a custom from class which will inherit the default forms.ModelForm class.

# forms.py
class UserAdminForm(forms.ModelForm):
    password =forms.CharField(label="Password", help_text="<Your Custom Message>", required=False)
class Meta:
    model = User
    fields = '__all__'

In the above form, We have overridden the password field to forms.CharField. Also, We can provide our custom message.

# admin.py
from django.contrib.auth import get_user_model
from django.contrib.auth import admin as auth_admin
from .forms import UserAdminForm

User = get_user_model()
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
    form = UserAdminChangeForm

Finally, this will display a custom message for the password field in the Django admin panel.

Back to Top