Question

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 =)

No correct solution

OTHER TIPS

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

it happend to me, evevtually 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

I had the same error for the same reason. Typo in another file that was imported by the one reported in the error. Revealed by importing manually into the shell.

Thanks kdazzle!

--Fred Stluka

I managed to solve the problem by opening the view file in vim and saving without any change.

Same problem.

My shell was not working too.

I saw the link that Jimenez posted, and at the end of discussion the guy solved the problem saving the file using Vim.

I rewrited the file using Vim and it worked!

Try it if your was not solved yet!

I had the same problem.

I had no clues, importing the module in the shell was not helpful at all: AttributeError: 'module' object has no attribute 'views'.
But I noticed that if I imported a specific module (that is imported in the views.py) before importing views, it worked.

I finally figured that the imported module also imported views.py, so it failed as each file was importing the other. No explicit message anywhere though.

Same issue because of cross view import between two files.

I've resolve it by moving import inside of each method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top