1

I am currently working on a django project. It already have a custom User model for authentication. Now I have to create a new app inside the same project which will have a authentication system for another type of users. Can I have two custom User model in same project? If yes, what will be the settings in settings.py as it only give option of specifying only one AUTH_USER_MODEL.

I am new to django and can't figure out the options available in django. Please help me out. i am stucked.

Shubham
  • 31
  • 5
  • Maybe these resources can help https://docs.djangoproject.com/en/1.9/topics/auth/customizing/#extending-the-existing-user-model http://stackoverflow.com/questions/44109/extending-the-user-model-with-custom-fields-in-django – Víctor M Feb 22 '16 at 13:09
  • I cannot use the user model as it is overrided by the custom User model I am already using – Shubham Feb 22 '16 at 13:13
  • in that page it shows you too how can you substitute the default User authentication in Django. – Víctor M Feb 22 '16 at 13:16
  • I have already substitute the default user authentication and wants another authentication backend but everywhere they use the default user to implement another backend. – Shubham Feb 22 '16 at 13:42
  • So what you want is if you can use another authentication backend, is it? – Víctor M Feb 22 '16 at 13:48
  • Yes, and what will I be writing in my settings.py file for AUTHENTICATION_BACKENDS as I cannot use django.contrib.auth.backends.ModelBackend because i have substituted the default user model – Shubham Feb 22 '16 at 13:51
  • Ok, can you write in your question that you want to use another backend authentication instead of a custom User model, please? Maybe this is the answer you are searching: http://stackoverflow.com/questions/17064443/django-multiple-authentication-backend-for-one-project-how – Víctor M Feb 22 '16 at 13:59
  • If I have no other option then I have to opt for another backend authentication but is there any way I dont have to use third party backend authentication – Shubham Feb 22 '16 at 14:08
  • Also the link you have given doesnt suggest which third party backend will be better which will give me same functionality as the default user authentication. – Shubham Feb 22 '16 at 14:11

0 Answers0