Hello,
I just want to add the subscription date in the User list in the Django CRUD Administration site. How can I do that ?
Thank you for your help
Hello,
I just want to add the subscription date in the User list in the Django CRUD Administration site. How can I do that ?
Thank you for your help
Assuming that your user class is User
and your subscription date field is subscription_date
, this is what you need to add on your admin.py
class UserAdmin(admin.ModelAdmin):
list_display = ('subscription_date',)
admin.site.register(User, UserAdmin)
I finally did like this in my admin.py file :
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
UserAdmin.list_display = ('email', 'first_name', 'last_name', 'is_active', 'date_joined', 'is_staff')
admin.site.unregister(User)
admin.site.register(User, UserAdmin)