所以我刚刚开始玩Django,我决定尝试在我的服务器上尝试。所以我安装Django和创建一个新的项目,按照教程中介绍的Djangoproject.comDjango ImportError在/无论我做什么
基础不幸的是,无论我做什么,我不能让意见的工作:我不断获得
ImportError at/
No module named index
Here是这个错误
我一直在谷歌上搜索,并没有运气尝试各种命令的截图,我真的即将撕我的头发,直到我变成秃头。我已经尝试将django源目录,我的项目目录和应用程序目录添加到PYTHONPATH中,但没有运气。我也确保init .py在所有的目录(包括项目和应用程序)中有没有人有任何想法可以在这里出错?
最新通报
对不起,我是实物仓促而张贴这,这里的一些背景:
我一直在试图将服务器只是Django的使用manage.py(建于服务器蟒manage.py 0.0.0.0:8000,因为我需要从外部访问的话)在Linux(Debian的)
APPDIR/views.py
from django.http import HttpResponse
def index(request):
return HttpResponse("Sup")
def test(request):
return HttpRespons("heyo")
urls.py
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^****/', include('****.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
(r'^test/', include('mecore.views.test')),
(r'^', include('mecore.views.index'))
)
您还有什么可以给我们的背景吗?例如哪个模块引发ImportError。堆栈跟踪会很有帮助。 – 2009-06-15 22:40:39
刚刚更新,希望这会帮助你们。 – 2009-06-15 23:52:29
@Sliggy:请不要发布错误的截图。复制并粘贴实际网页中的实际文字,比屏幕截图更有用。 – 2009-06-16 00:41:32