2 ms·
Can you expand on the "jaw-dropping nastiness you have to go through to make it work"? Seems pretty straightforward, though I have not tried to actually use it
by jonknee 14y ago
Can you expand on the "jaw-dropping nastiness you have to go through to make it work"? Seems pretty straightforward, though I have not tried to actually use it yet.
https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#auth-custom-user https://docs.djangoproject.com/en/1.5/topics/auth/customizin...
It appears the database migration is the biggest hurdle, but I don't think there's a way around that. User profiles require a join and that can be suboptimal, which is why this is a useful addition. If you weren't running into problems before it's probably better to not change (though that's usually the case for working code).
- jarcoal 14y agoIn case anyone is considering the migration, it's actually very simple with South. Here is a step-by-step: 1) Setup custom user model to inherit from AbstractUser with no additional fields. 2) Meta.db_table = 'auth_user' on custom user model 3) schemamigration --auto 4) migrate --fake (alternatively comment out statements in migration file and run without fake) Now you can add new fields or change the inheritance to AbstractBaseUser and south will follow along.
- Jasber 14y agoI can't speak for obviouslygreen, but I recently implemented the new User model and was a bit surprised by all the stuff I had to do myself. I just wanted to add one field to the user model, but to do that I had to add 100+ lines of code. I am very happy custom User models are possible now––but for most stuff I'll probably keep using a UserProfile.
- jarcoal 14y agoWhat field were you adding? Are you aware of django.contrib.auth.models.AbstractUser?