58👍
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
7👍
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
- [Django]-What is the absolute path of BASE DIR?
- [Django]-Django change default runserver port
- [Django]-How to use 'User' as foreign key in Django 1.5
2👍
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
- [Django]-How to escape {{ or }} in django template?
- [Django]-You are trying to add a non-nullable field 'id' to contact_info without a default
- [Django]-Django forms, inheritance and order of form fields
1👍
I managed to solve the problem by opening the view file in vim and saving without any change.
- [Django]-Jquery and Django CSRF Token
- [Django]-Django: show raw html (from database) as html, not rendered
- [Django]-Annotate a queryset with the average date difference? (django)
0👍
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!
- [Django]-Django related_name for field clashes
- [Django]-Django unit test without creating test database every time I run
- [Django]-How to debug Jinja2 template?
0👍
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.
- [Django]-Django: How do I add arbitrary html attributes to input fields on a form?
- [Django]-Django vs other Python web frameworks?
- [Django]-Filtering only on Annotations in Django
0👍
Same issue because of cross view import between two files.
I’ve resolve it by moving import inside of each method.
- [Django]-Add Indexes (db_index=True)
- [Django]-Django, Retrieve IP location
- [Django]-How do I insert a django form in twitter-bootstrap modal window?