mirror of
https://github.com/django/django.git
synced 2025-08-16 16:50:33 +00:00
[1.11.x] Fixed #27911 -- Doc'd how to register custom User with admin.
Backport of 9269dec05e
from master
This commit is contained in:
parent
33d2c53fb1
commit
c7351eaa92
1 changed files with 8 additions and 0 deletions
|
@ -411,6 +411,14 @@ model, but you'll be able to customize it in the future if the need arises::
|
||||||
Don't forget to point :setting:`AUTH_USER_MODEL` to it. Do this before creating
|
Don't forget to point :setting:`AUTH_USER_MODEL` to it. Do this before creating
|
||||||
any migrations or running ``manage.py migrate`` for the first time.
|
any migrations or running ``manage.py migrate`` for the first time.
|
||||||
|
|
||||||
|
Also, register the model in the app's ``admin.py``::
|
||||||
|
|
||||||
|
from django.contrib import admin
|
||||||
|
from django.contrib.auth.admin import UserAdmin
|
||||||
|
from .models import User
|
||||||
|
|
||||||
|
admin.site.register(User, UserAdmin)
|
||||||
|
|
||||||
Changing to a custom user model mid-project
|
Changing to a custom user model mid-project
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue