Best Practices Creating a User

25 views
Skip to first unread message

Debjyoti Biswas

unread,
May 5, 2020, 9:16:14 AM5/5/20
to Django users
Hi

I am a new Django user, I am working on a platform and I chose Django to develop it solely because of how "batteries included" it feels.

I have to create users for my platform when they sign up, I was just wondering if its best practice to use `User` from `django.contrib.auth.models` for this. The user in my case will have different levels of access and also there will be different types of users like Vendors and Clients, logically I would use different user Models.

Just wondering what's the best practice.

Regards

Gs_1001

unread,
May 5, 2020, 10:16:31 AM5/5/20
to Django users
The documentation provides some ways to extend the functionality of the user model But the thing I didn't know at first was that once you have your application working and all, it's quite difficult to make changes to the user model. So I always prefer to make a CustomUser model at the start of a project.
At first the attributes being stored are quite minimal but I end up accumulating some data into the user model at the end.

"Using a custom user model when starting a project" in django documentation also highlights this:
https://docs.djangoproject.com/en/3.0/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project
Reply all
Reply to author
Forward
0 new messages