dingx
dingx

Reputation: 1671

About change AUTH_USER_MODEL and customize the built-in User model

The doc says" If you intend to set AUTH_USER_MODEL, you should set it before creating any migrations or running manage.py migrate for the first time.".
So i want to double check about this, and is it possible to change the built-in User model the DB setup?

Upvotes: 1

Views: 1465

Answers (1)

Burhan Khalid
Burhan Khalid

Reputation: 174662

You can create your own user model rather than changing the built-in one. That's what AUTH_USER_MODEL does. It tells django to use your user model as the default, rather than the default django.contrib.auth.models.User.

You should do this once in the beginning of the project and then stick with whatever you have setup; as this setting has effects for many other areas of the framework. That is why there is a warning in the documentation.

Upvotes: 1

Related Questions