Custom Backend vs AUTH_USER_MODEL

27 views
Skip to first unread message

Ketan Chaturvedi

unread,
Jun 21, 2020, 1:00:15 PM6/21/20
to Django users
I am having a great confusion regarding these 2 terms.

1. Custom Backend is used to authenticate users using custom model in place of User module.
2. AUTH_USER_MODEL setting also allows to swap a custom model in place of User module.

So where is the difference between the two??

I am a newbie to Django, so please correct me if I am wrong anywhere.

Mike Dewhirst

unread,
Jun 21, 2020, 10:00:31 PM6/21/20
to django...@googlegroups.com, Ketan Chaturvedi
On 21/06/2020 10:15 pm, Ketan Chaturvedi wrote:
I am having a great confusion regarding these 2 terms.

1. Custom Backend is used to authenticate users using custom model in place of User module.

Not necessarily. Custom authentication backend is only required if the Django auth backend doesn't suit your needs. Don't mix it up with a custom user.


2. AUTH_USER_MODEL setting also allows to swap a custom model in place of User module.

Just remove the word "also" above and your statement becomes correct.

If you are a Django newbie you probably don't need either 1 or 2 for your first couple of practice projects. As soon as you want to do a real project you definitely want a custom user model.

Welcome

Mike


So where is the difference between the two??

I am a newbie to Django, so please correct me if I am wrong anywhere.
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6e406482-bdc7-4f9d-a181-9c247fdabc78o%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages