Questions tagged [abstractuser]

30 questions
0
votes
1 answer

Django abstractuser can't set parameters

I am trying to set a flag when a user signs up. The flags show up on the admin site, so I know the abstract user was implemented. When I toggle them in the admin area it works as well. I just can't get the form to work for regular users. I have…
Pat
  • 81
  • 4
0
votes
0 answers

NOT NULL constraint failed: products_product.vendor_id django

so i recently changed my project user form to abstract base user and well my users can not add products or view their profile i know its problem in views.py and forms.py but whatever i change it in to is still has some problems beside the error in…
0
votes
1 answer

How to get the plane password of Django admin user in pre_save signal when creating user from admin panel?

I need to log Django admin users in 3ed party authentication service. For that I need plane password without hashing. Here I used pre_save signal. That approach works well when I create an API endpoint for registration. But when I create an admin…
0
votes
1 answer

AUTH_USER_MODEL refers to model 'users.CustomUser' that has not been installed

models.py User = get_user_model() class CustomUser(AbstractUser): sign = models.ImageField(upload_to=image_saving) objects = CustomUserManager() this is my models.py I tried to add just an extra field to django User…
user15446178
0
votes
1 answer

Please enter the correct email address and password for a staff account. Note that both fields may be case-sensitive. django

I am using an abstractbase user. When I run python manage.py createsuperuser, it successfully created it but always gets that error and I don't know where is the problem. And also I put in the required fields the username and the birth date as I…
0
votes
1 answer

Best solution for extending user model twice (Student / Teacher)

I'm coding a application in Django where there are 2 types of users that need to login on the webapplication: teachers and students. Now I'm not sure what is the best approach for this. I already read a lot of tutorials and Stackoverflow questions…
RVE
  • 328
  • 4
  • 17
0
votes
1 answer

Cannot Update Custom User (AbstractUser)

I am using a custom user model which inherits from the AbstractUser and when I save a user it works well. But whenI need to update the model and I click on my submit button on my template nothing happens. Nothing shows in the console, the page does…
Dane
  • 11
  • 4
0
votes
0 answers

Custom User subclassing AbstractUser giving NoReverseMatch when called in listview template

I am in need of some help. The best way I can describe my problem as how I have done in the title and I get a noreverse match error. Can anyone shed some light as to why I am getting this problem. Here is my code. # model code from…
Dane
  • 11
  • 4
0
votes
1 answer

How to access request.user with AbstractUser class

I am trying to create an order object and assign the order's customer field (which is a foreign key for User) to the current user. Even though it passes the if statement and it can authenticate the request.user, it assigns customer as a blank…
sthompson232
  • 52
  • 1
  • 7
0
votes
0 answers

Inheritance from an AbstractUser based Model in django 2.7

I have a Custom User Model extending the AbstractUser and it works fine. But now i want to create another Model that is extending my Custom User Model like this in models.py: class CustomUser(AbstractUser): phone =…
0
votes
3 answers

Django custom user with AbstractUser

from django.contrib.auth import get_user_model from django.contrib.auth.models import AbstractUser class MyUser(AbstractUser): pass class Landlord(models.Model): user = models.OneToOneField(get_user_model(), on_delete=models.CASCADE) …
Jaha
  • 3
  • 2
0
votes
0 answers

Django (fields.E304) - AbstractUser

I would like to create new fields in the model of the Django's User system. I am following the official documentation, but I keep getting the same error: My changes so far to the code have been the following: models.py: from django.db import…
user8558694
0
votes
1 answer

Django ORM multiple table join with AbstractUser

I googled but got confused in multiple table join (with 1:1, 1:n, and n:m relations). My models looks like this: class User(AbstractUser): is_student = models.BooleanField(default=False) is_teacher =…
user2208882
  • 77
  • 1
  • 4
-1
votes
1 answer

How do i add other fields on Abstract User

This is my model. When i make migrations it is not showing up on my admin page. class User(AbstractUser): # TODO User will be associated with one or more chama accounts id_number = models.IntegerField(default=0) phone_number =…
-2
votes
1 answer

"detail": "Authentication credentials were not provided." when I want to signup user

when I want to post data and create a new teacher it gives me this error and I don't know what to do please help me this is my models.py this is my views.py this is my serializer.py
1
2