I once encountered the same problem with a Custom User ModelThe solution that 
worked for me was putting under the is_staff = True It wouldnt log in even afte 
that then I added the following methods under my Userdef has_perm(self, perm, 
obj=None):   return Truedef has_module_perms(self, app_label):   return Trueand 
these three decorator functions@propertydef is_admin(self):  return 
self.admin@propertydef is_staff(self):    return self.staff@propertydef 
is_active(self):    return self.activeThus worked for me and you can always try 
out and seeThanksSent from my Samsung Galaxy smartphone.-------- Original 
message --------From: Tafadzwa Marshal <marsha...@gmail.com> Date: 2019/12/17  
00:22  (GMT+02:00) To: django-users@googlegroups.com Subject: Re: User is not 
logging in admin panel hello, your problem is easy to solve. The 
'createsuperuser' command creates a user with the 'staff' attribute set to 
true. When you create a user throughthe model thats inheriting from the User 
model, the default for the 'staff' attribute is set to false. The solution is 
to make sure you override the save methodand set the 'staff' attribute to true. 
On Mon, Dec 16, 2019 at 3:38 AM sagar ninave <sagarnin...@gmail.com> 
wrote:Hello Everyone,i am getting some issue please help me.i have created 
custom user model in account app by extending auth user model. also i have 
creates register api to register user. i am able to create superuser from 
command prompt and api as well. and both user are storing in single User model 
along with when i am hitting get request and i got response all user which 
register from command prompt and api. problem is that User is able to logging 
in admin panel which is registered by command line by command python manage.py 
createsuperuser but user is not able tologging in admin panel user which is 
created by register api. when i am seeing data of both user created by cmd and 
created by register api in admin panel that CMD created user's password is 
encrypted and user created by register api is plain text. may be at the time of 
creating superuser password is saving in encrypted form and user registered by 
api his password is saving in plain text form so that it may not authenticating 
user to redirect on admin panel. so what is happening exactly please clear this 
doubt and help to get out from this situation 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a962e5fd-c41d-465c-a179-14f84ace9551%40googlegroups.com.




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFgO-6hUKDCcHqt9vZP645rAksuKjNhuPRyG3JPv1TQTQL948A%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/qvuph1k0hok2q6s6sf30h3ug.1576538293475%40email.android.com.

Reply via email to