🍡 Django Tutorial
Custom User Class

Updated at 2018-11-23 18:12

Create djangor/models/ This is required to customize user entities in the future.

from django.contrib.auth.models import AbstractUser

from djangor.model_mixins import UUIDMixin

class User(UUIDMixin, AbstractUser):

Create djangor/models/

from .users import User

Create djangor/

from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User, UserAdmin)

Add following to djangor/

# Application definition
    # ...

# User substitution
AUTH_USER_MODEL = 'djangor.User'

Start the application

python makemigrations djangor
python migrate
python runserver
# navigate to http://localhost:8000/ to see your new django project in action
# dev server automatically reloads Python code for each request as needed