作成したコートを詳しくみてみましょう。 Postはauthor, title, content, created_at, updated_at, published_atのフィールドを持っています。 authorはForeignKeyファンクションを使って、ジャンゴ(django)が基本的提供してるauthアプリケーションのUserモデルを参照するように作りました。 対応するテンプレートを作成します。 allauthにもデフォルトテンプレートがありますが、カスタマイズする場合がほとんどなので別途用意しました。 コードはallauthライブラリ内にあるものをコピーしてきました。 Ticket for refactoring django.contrib.auth.views to use class-based views - 17209 Ticket for refactoring django.contrib.auth.forms.UserCreationForm to work with custom user models. I updated my post with my views and serializers, but i was importing it wrong, had .models in from django.contrib.auth.models import get_user_model – MaxenceP Mar 27 at 2:21 - 19353 Much of the code for the refactoring work has already been written, but for some reason the tickets stagnated and never fully made it into master. Teams Q&A for Work Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. from django.contrib.auth import views as auth_views urlpatterns = [url ('^change-password/$', auth_views. from django.db import models from django.contrib.auth.models import (BaseUserManager, AbstractBaseUser) class UserManager (BaseUserManager): def create_user (self, email, date_of_birth, password = None): if not email: from django.contrib.auth.models import User, Group from rest_framework import viewsets from tutorial.quickstart.serializers import UserSerializer, GroupSerializer class UserViewSet(viewsets.ModelViewSet): """ 允许用户查看或 django.contrib.auth.base_user.AbstractBaseUserを継承する django.contrib.auth.models.AbstractUserを継承する AbstractUserはデフォルトのUserモデルが持っている機能を全て持っており、デフォルトUserに少し手を入れたい場合に向い password_change),] auth_views는 view의 상태를 변경할 수 있는 옵션 인자를 받는다.