2 ms·
The amount of work involved is entirely dependent on how different your User model is. If you've got a model where the username is even similar to the normal Dj
by freakboy3742 14y ago
The amount of work involved is entirely dependent on how different your User model is. If you've got a model where the username is even similar to the normal Django User, you don't need to redefine anything - you can use the existing forms and ModelAdmin.
If your model uses a different identifer field (e.g., email, rather than username), or doesn't share common fields with the default User, then yes, you'll need to redefine some forms. That shouldn't be too surprising, though -- if you've created a model that's nothing like Django's default User model, it shouldn't be surprising that you need to do some work to support it.
However, you shouldn't need to redefine any views, and the forms that need redefinition are fairly simple -- a fully worked example is in the docs.
On top of that, those forms and ModelAdmin definitions should be extremely reusable - it will be easy to package an "email-based" user model for reuse between projects.
- arocks 14y agoI was trying to extend AbstractUser with just one extra field and realised that it was not easy. But then you are correct that it is how rest of Django works.