Paul R
Paul R

Reputation: 2797

Override field to allow NULL in django model

Django user model works for me, but I want to make username nullable.

What is a clean way to do it?

Upvotes: 1

Views: 137

Answers (1)

martinarroyo
martinarroyo

Reputation: 9701

You can just create a custom user model by extending the AbstractBaseUser class. There is a nice example in the documentation. As it is mentioned there, you just need to have some sort of unique identifier for the user that will be used for authentication. I hope that helps.

Upvotes: 2

Related Questions