Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django 1.5: user and additional info

Tags:

django

I have an authentication system based on django auth, but I have to add information to users. What is the best way to do that in django 1.5? (In 1.4 i was using a profile linked with onetoone to user, but now?)

like image 509
tapioco123 Avatar asked Dec 31 '12 17:12

tapioco123


1 Answers

Django 1.5 has extendable User models. Basically, you can extend an abstract base user model, add your fields and anything and use it from there.

The base model only has the basics for authentication – the password field and a field for the time of the last login. You even have to create your own username field. If you're comfortable with something like current Django User model (with username, first name, last name, etc.), it also exists as AbstractUser and you can extend it instead of AbstractBaseUser and add your own fields.

like image 101
justinas Avatar answered Sep 23 '22 11:09

justinas