Questions tagged [abstractuser]
30 questions
5
votes
3 answers
HINT: Add or change a related_name argument to the definition for 'CustomUser.user_permissions' or 'User.user_permissions'
I need help. I'm creating an app in Django and I'm having some trouble making migrations of my custom user's class. The error is:
ERRORS: auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for…

RostenRoss
- 81
- 2
- 3
2
votes
1 answer
Making different registration forms in Django?
I'm trying to create two different types of users in Django using AbstractUser. I've created two models that inherit from my AbstractUser model.
How do I update the UserCreationForm so that it has a field for user type?

Bcomposer
- 47
- 6
2
votes
1 answer
Django - Login required for specific user type
I extended the user login from Django with AbstractUser like this:
class User(AbstractUser):
pass
class Seller(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
verified = models.BooleanField(default=False)
…
user8558694
1
vote
0 answers
Null value error, I am using Django rest framework and when I want to get enrolled data inside login response it gives me null instate of the values
I want to get enrolled courses for individual student with login I put enrolled model inside the login response put it will give me null instate of courses here is me output and code
output:
{
"token":…

Bawar Rwandzy
- 11
- 5
1
vote
1 answer
I got ValueError: Related model 'useraccount.user' cannot be resolved in my django app when I tried to migrate AbstractUser?
This error occurred when I try to migrate.
└─$ python3 manage.py migrate 130 ⨯
Operations…

rlopxhan21
- 51
- 4
1
vote
2 answers
How to update user details in custom user model in django
i just created a custom user model from abstractuser. I can create user but update is not working showing some error. I am also week in english so idk how to share my problem. In short hand i want to edit email and password of a user.
###This is my…

Bakugo
- 21
- 4
1
vote
1 answer
Django: what is the best way to create models for students and tutors and both of them have different profiles?
I've done a lot of searching for this and even watched some tutorials, and most of them have different kinds of approach which makes me question myself if what I'm doing right now is correct. But I still tried to implement which I think is the best…

JustinAlvarez
- 49
- 5
1
vote
1 answer
How do I run Django test using a CustomUser(AbstractUser) class instead of default AbstractUser for correct ForeignKey assignment during test?
I have a CustomUser model in 'accounts' app that overrides Django's default auth.User:
class CustomUser(AbstractUser):
age = PositiveIntegerField(null=True, blank=True)
user_type = CharField(max_length=8, null=False, choices=[('customer',…

damonmickelsen
- 43
- 4
0
votes
1 answer
Can I create an instance of AbstractUser in my model class in the model.py in django?
I am new to django and from a tutorial video, in the model.py file for the profile app, he created an instance of the User model in a one-to-one relationship with the profile model class like so:
`
from django.contrib.auth.models import User
class…

theocode
- 69
- 8
0
votes
2 answers
How to properly extend user model in Django
I am working on a Django employee management system, I want the employee bio data on the same table as the user object used for registration and login
I tried adding the user model as a OnetoOneField on the employee table, but I don’t like having to…

Raji Muhammad
- 37
- 6
0
votes
1 answer
Django - Add extra clause for login with AbstractUser inheritance
I have the following model:
employee.py
class Employee(auth_models.AbstractUser, MetadataModel):
user = models.CharField(unique=True, primary_key=True)
first_name = models.CharField(blank=True, null=True)
last_name =…

Adrian Gil Moral
- 3
- 2
0
votes
0 answers
How to get username field automatically in Django
I am working on a Django project which is something similar to Fiverr in its working. I have used abstractuser where there is a buyer and seller. The seller creates a gig then the buyer will go through the gig before placing an order. My issue is…

KipronoKirui
- 31
- 1
- 7
0
votes
2 answers
Django - Can't login into admin site with user create directly from admit site
So, i have created a Customer user model using AbstractUser
Model.py
class Department(models.Model):
department_name = models.CharField(max_length=20)
def __str__(self):
return self.department_name
class Role(models.Model):
…
user7477875
0
votes
1 answer
How to change max_length of username in AbstractUser
Model.py
class User(AbstractUser):
username = models.CharField(max_length=20)
Why does the phrase below appear in cmd?
WARNINGS:
ourtube.User: (auth.W004) 'User.username' is named as the 'USERNAME_FIELD', but it is not unique.
HINT: Ensure that…

m tam
- 3
- 2
0
votes
1 answer
How to Verify Email in Django using OTP and UserCreationForm
I am creating a Quiz App. In that I have a sign up page for user authentication which is using the default User Model and User CreationForm. I want to add a email verification in it by sending a otp on the email.
Please explain me how can I send otp…

Shubham Dubey
- 1
- 1
- 1