Forums

ImportError: cannot import name views

I'm using custom user model which is under user app and django rest framework. In urls.py file when i try to import views of user app with code

from user import views as userviews

it gives me error :

ImportError: cannot import name views.

It is working fine in development copy. I cannot figure out the exact cause in pythonanywhere.

Is this any help? https://www.pythonanywhere.com/wiki/DebuggingImportError

Found it !! My app name was user and it was calling system package. I changed app name and its working . Thanks !!

hooray!

that issue with namespace clashes really is a pain. we'll have to figure out a better solution someday...