Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there are any way to add 2 models as auth-user-model?

i have created 2 apps user and a vendor.
This is the error i am facing.

"
AttributeError at /users/admin/login/
Manager isn’t available; ‘auth.User’ has been swapped for ‘vendors.Vendor’
Request Method: POST
Request URL: http://127.0.0.1:8000/users/admin/login/
Django Version: 5.1.3
Exception Type: AttributeError
Exception Value:
Manager isn’t available; ‘auth.User’ has been swapped for ‘vendors.Vendor’"

Can i add both the Vendor and user ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

No.
But here’s my suggestion:
According to the logs you provided, it seems like you want to replace your old user model with new one. I would recommend going thru’:
AbstractUser & AbstractBaseUser in django.

Well basically, you may just ask chat gpt on how to configure these in your django project.

NOTE: you would need fresh db.

I hope this helps you!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading