django-admin

User can't login because of "Invalid password format or unknown hashing algorithm."-Django

User can't login because of "Invalid password format or unknown hashing algorithm."-Django Question: I’m learning Django and tried to write my own custom user model. I’m not using DRF and serializers and stuffs I have no idea about 🙂 I am using createView to create users but I can’t login because "Invalid password." I checked …

Total answers: 1

Django Admin doesn't recognise blank=True in model

Django Admin doesn't recognise blank=True in model Question: When I try to edit a user (using a custom UserChangeForm) in the Django admin panel, validation insists that fields I have set blank=True in the model are required. I don’t know where to begin solving this; I had the same issue with the CustomUserCreationForm but reverted …

Total answers: 1

How to show only one object in django admin list view?

How to show only one object in django admin list view? Question: Problem I wish to show only the last row of a QuerySet based on the ModelAdmin‘s ordering criteria. I have tried a couple of methods, but none has worked for me. Model: class DefaultConfig(models.Model): created_at = models.DateTimeField() … Attempt 1: I tried overriding …

Total answers: 1

how to not let staff or admin users edit superusers

how to not let staff or admin users edit superusers Question: I’m working on permission distribution and according to my user model structure, staff and admin users are allowed to edit is_staff and is_admin for other users, not themselves. But with such power, they are able to edit those booleans for superusers too, which I …

Total answers: 2

Can't access Django Admin with my Custom User credentials

Can't access Django Admin with my Custom User credentials Question: I created an app ‘accounts’ from which I created my CustomUser. Then, I created superuser from the command line successfully. But I can’t login to Django Admin. Everytime, it displays "Please enter the correct username and password for a staff account. Note that both fields …

Total answers: 1

restrict django choice field on django admin per user

restrict django choice field on django admin per user Question: I have an exam like this: class Exam(BaseModel): … STATE_CHOICES = ( (PASS, PASS), (FAILED, FAILED), (GREAT, GREAT), state = models.CharField(max_length=15, choices=STATE_CHOICES, default=PASS) … Inside Django admin, I want the user with group X to be able to only change the state only from FAILED …

Total answers: 1

How are the names of model items not showing up in DJango Admin?

How are the names of model items not showing up in DJango Admin? Question: I’m building a website using python and Django, but when I looked in the admin, the names of the model items aren’t showing up. So, the objects that I am building in the admin aren’t showing their names. admin.py: from .models …

Total answers: 2