Django 1.1 崩溃,找不到 urls 模块
编辑:问题已解决,在下面回答。 蹩脚的错误。 等等,
所以我升级到了 Django 1.1,但我一辈子都不知道我错过了什么。 这是我的回溯:
http://dpaste.com/37391/ - 这发生在我尝试的任何页面上要去。
我修改了 urls.py 以将管理员包含在新方法中:
从 django.contrib 导入 admin
admin.autodiscover()
...urlpatterns 声明
(r'^admin/', include(admin.site.urls)),
我尝试过摆弄路径等,但没有解决我的问题我不明白。
自 Django 1.1 alpha 以来有一些重大变化 -> 我缺少 Django 1.1 beta 吗? 除了管理员之外我看不到还有什么新内容。 url 是否仍存储在每个应用程序内的 urls.py 中?
感谢您提前提供的帮助,这实在令人沮丧。
EDIT: Issue solved, answered it below. Lame error. Blah
So I upgraded to Django 1.1 and for the life of me I can't figure out what I'm missing. Here is my traceback:
http://dpaste.com/37391/ - This happens on any page I try to go to.
I've modified my urls.py to include the admin in the new method:
from django.contrib import admin
admin.autodiscover()
.... urlpatterns declaration
(r'^admin/', include(admin.site.urls)),
I've tried fidgeting with paths and the like but nothing fixes my problem and I can't figure it out.
Has something major changed since Django 1.1 alpha -> Django 1.1 beta that I am missing? Apart from the admin I can't see what else is new. Are urls still stored in a urls.py within each app?
Thanks for the help in advance, this is beyond frustrating.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想到了。 我丢失了我引用的 urls.py (出于某种原因,SVN 说它在存储库中,但从未在更新时获取它),它只是说找不到 url(没有引用 Notes.urls ,而它丢失了) )所以它变得非常混乱。
不管怎样,修复了——太棒了!
I figured it out. I was missing a urls.py that I referenced (for some reason, SVN said it was in the repo but it never was fetched on an update) and it simply said could not find urls (with no reference to notes.urls which WAS missing) so it got very confusing.
Either way, fixed -- Awesome!
settings.py 文件中 ROOT_URLCONF 的值是多少? 该设置命名的文件是否在您的 python 路径上?
您使用的是开发服务器还是什么?
What is the value of your ROOT_URLCONF in your settings.py file? Is the file named by that setting on your python path?
Are you using the development server or what?
试试这个:
更多信息
Try this:
More info