OneCompiler

How to fix ImportError: cannot import name user

In Django, I created a model.

But it is giving me an error on the below line

from django.contrib.auth import user

How to fix the error?

1 Answer

6 years ago by

You missed the models in import.

try like below

from django.contrib.auth.models import User
6 years ago by Divya