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

5 years ago by

You missed the models in import.

try like below

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