Customising django user model

33 views
Skip to first unread message

Sipum

unread,
May 19, 2019, 1:13:08 PM5/19/19
to Django users
Hello Friends,

I want to customise django default user table and which should consist of name,phone, email and gender.
And after that when every time a user logs in, he/she should able to log in through an OTP to phone or email.

can anyone guide me  What to do here.??

Thanks.
Sipum

Rafael E. Ferrero

unread,
May 20, 2019, 8:06:09 AM5/20/19
to django...@googlegroups.com
Hello, you must to extend User model... search on google with this aproach!! 

Cheers!

Rafael E. Ferrero


--
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 post to this group, send email to django...@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/9b92fdc5-8f36-45e7-809e-b32d4ab41687%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sipum Mishra

unread,
May 20, 2019, 1:28:40 PM5/20/19
to django...@googlegroups.com

Joe Reitman

unread,
May 20, 2019, 8:20:25 PM5/20/19
to Django users
You can customize the user table by extending AbstractUser and add the fields you want to add (gender, phone)

I have a custom user example adding age field:

from django.db import models
from django.contrib.auth.models import AbstractUser

class CustomUser(AbstractUser):
   age
= models.PositiveIntegerField(null=True, blank=True)

mahesh boini

unread,
May 20, 2019, 10:45:00 PM5/20/19
to django...@googlegroups.com
Extend AbstractUser class and give that name in settings file like
AUTH_USER_MODEL=‘appname.modelname’

--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Sipum Mishra

unread,
May 20, 2019, 11:11:27 PM5/20/19
to django...@googlegroups.com
Thanks a lot.. @Joe @Mahes
It will help me a lot. 

אורי

unread,
May 22, 2019, 8:32:23 AM5/22/19
to django...@googlegroups.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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages