Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django views does not exist or could not import

This morning i have been working on my project. I finished what i was doing and i pushed new code to git.

Now, i went to run my project to start working on it and index view does not run!

Could not import ism.views.index. View does not exist in module ism.views.

This view ran without any kind of problem. All the project ran.

There is something more incredible. i tried and checked other views after main view (ism.views.index) failed and all of them worked, but not now! All the views ran correctly 10 seconds ago and now neither works. They spit the same error of main view.

I found searching around the Internet this related topic:

It's magic the view does not exist for django but it worked 5 secondes before and it still exist

But i have tried to remove original file (views.py in ism app) and to write it again, and the problem persist. The same with all the rest views.py.

Anyone knows something about this issue?

Thanks =)

like image 619
Rubén Jiménez Avatar asked May 15 '12 01:05

Rubén Jiménez


2 Answers

Try doing a

    python ./manage.py shell 

and then importing the view that is giving you the problem. That might end up giving you more useful debugging information.

> from ism.views import index 
like image 163
kdazzle Avatar answered Sep 29 '22 05:09

kdazzle


It happened to me, eventually the problem was I had a syntax error in one of the forms in forms.py, and I imported this form into my views.py file. Django error message still pointed me to view does not exist error

like image 33
yeinhorn Avatar answered Sep 29 '22 05:09

yeinhorn