Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

257
Visualizações
Displaying the correct django authentication framework information in custom admin page

I am trying to display the password in the Admin backend table in the following way, containing the algorithm, iterations, salt and hash:

enter image description here

However, my current page looks like the following:

enter image description here

As you can see it is just the hashed password, not displaying any of the information unlike the above. Can anyone see where I am going wrong?

Please find my code below:

from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from hobbies.models import extendedUser, User, Hobby
from .forms import LoginForm, SignUpForm
from django.forms import ModelForm
from django.contrib.auth.forms import ReadOnlyPasswordHashField

#admin.site.register(User,UserAdmin)



class CustomUserAdmin(UserAdmin):
    add_form = SignUpForm
    form = LoginForm
    model = extendedUser
    readonly_fields = ["password"]
    list_display = ('email', 'is_staff', 'is_active',)
    list_filter = ('email', 'is_staff', 'is_active',)


    fieldsets = (
        (None, {'fields': ('email', 'password', 'city')}),
        ('Permissions', {'fields': ('is_staff', 'is_active')}),
    )

    add_fieldsets = (
        (None, {
            'classes': ('wide',),
            'fields': ('email', 'password', 'is_staff', 'is_active')}
        ),
    )
    search_fields = ('email',)
    ordering = ('email',)

admin.site.register(User, CustomUserAdmin)

Thank you for your time, Alex

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I think they use display using this function:

get_session_auth_hash() which is a part of the base abstract user in django.contrib.auth.base_user

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda