Django: import auth user to the model

from django.contrib.auth.models import User

You missed the models – and user is capitalized.

If you use a custom user model you should use:

from django.contrib.auth import get_user_model
User = get_user_model()

More details can be found in the docs.

Changed in Django 1.11:

The ability to call get_user_model() at import time was added.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)