The answer on this link can also help you in why and when to use get_user_model(). https://stackoverflow.com/questions/24629705/django-using-get-user-model-vs-settings-auth-user-model
On Feb 18, 2018 4:11 AM, "tango ward" <tangowar...@gmail.com> wrote: Hi, I am playing around with user registration. I came across a code where the get_user_model() was assigned to a model in Meta class inside a form. I was just wondering, what is the benefit of using the get_user_model() as Model in a form instead of importing a class from models.py then use that class as model of the form and when should I use it? models.py class RegUser(User): def __str__(self): return self.username forms.py class UserCreateForm(UserCreationForm): class Meta: fields = ('username', 'password1', 'password2') model = get_user_model() Thanks, Jarvis -- 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 post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/ msgid/django-users/CAA6wQL%2Bq1kQ7ukjtE3gV64iu9y2SXdgojZX BF3R46BCuTN0xoA%40mail.gmail.com <https://groups.google.com/d/msgid/django-users/CAA6wQL%2Bq1kQ7ukjtE3gV64iu9y2SXdgojZXBF3R46BCuTN0xoA%40mail.gmail.com?utm_medium=email&utm_source=footer> . For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACRd7haky8%2BY7%2BNDHNFV3EbiSxBU4B65CJUSF7v3mXb3%3DP8D%2BA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.