refs #20233 - Full custom user model example isn't really full

Addition and fix for custom user model example documentation.

https://code.djangoproject.com/ticket/20233
This commit is contained in:
postrational 2013-05-19 10:48:30 +02:00
parent 398841d6d3
commit 0b3a6ead88
1 changed files with 5 additions and 1 deletions

View File

@ -1075,7 +1075,6 @@ code would be required in the app's ``admin.py`` file::
(None, {'fields': ('email', 'password')}), (None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('date_of_birth',)}), ('Personal info', {'fields': ('date_of_birth',)}),
('Permissions', {'fields': ('is_admin',)}), ('Permissions', {'fields': ('is_admin',)}),
('Important dates', {'fields': ('last_login',)}),
) )
add_fieldsets = ( add_fieldsets = (
(None, { (None, {
@ -1092,3 +1091,8 @@ code would be required in the app's ``admin.py`` file::
# ... and, since we're not using Django's builtin permissions, # ... and, since we're not using Django's builtin permissions,
# unregister the Group model from admin. # unregister the Group model from admin.
admin.site.unregister(Group) admin.site.unregister(Group)
Finally specify the custom model as the default user model for your project using the :setting:`AUTH_USER_MODEL` setting in your ``settings.py``::
AUTH_USER_MODEL = 'customauth.MyUser'