Django视图不存在或无法导入 [英] Django views does not exist or could not import

查看:130
本文介绍了Django视图不存在或无法导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天早上我一直在为我的项目工作。我完成了我在做什么,我推新的代码到git。



现在,我去运行我的项目开始工作,索引视图不运行! / p>

 无法导入ism.views.index。模块ism.views中不存在视图。 

此视图没有任何问题。所有的项目都跑了。



有一些更令人难以置信的东西。主视图(ism.views.index)失败后,我试过检查其他视图,所有这些视图都工作,但现在不行!所有的视图在10秒前正常运行,现在都不起作用。我们发现在互联网上搜索这个相关的主题:



a href =http://python.6.n6.nabble.com/It-s-magic-the-view-does-not-exist-for-django-but-it-worked-5-secondes-before- and-it-still-exists-td4695300.htmlrel =noreferrer>这是魔术的观点不存在于django,但它之前工作5秒,它仍然存在



但是我尝试删除原始文件(在ism应用程序中的views.py)并再次写入,问题仍然存在。任何人都知道有关这个问题的一些问题吗?



谢谢=

解决方案

尝试做一个

  python ./manage.py shell 

然后导入导致问题的视图。这可能会为您提供更有用的调试信息。

 >来自ism.views import index 


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

解决方案

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

这篇关于Django视图不存在或无法导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆