所以我正在关注programmersbook.com的教程,我已经完成了位于http://www.youtube.com/watch?v=hTq98PGOqMA&feature=share&list=PL385A53B00B8B158E的第7个视频。
将命令传递给 ./manage.py runserver 后,我收到以下错误。
ImportError at /admin/
No module named apps.homepage
以下是文件的内容和目录结构(如果需要)。
博客/博客/urls.py
from django.conf.urls import patterns, include, url
from blog.apps.homepage import *
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
(r'^', include('blog.apps.homepage.urls')),
# Examples:
# url(r'^$', 'blog.views.home', name='home'),
# url(r'^blog/', include('blog.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)
博客/应用程序/主页/urls.py
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^$', 'blog.apps.homepage.views.index'),
)
博客/应用程序/主页/views.py
from django.http import HttpResponse
def index(request):
return HttpResponse('Index Page')
以防万一这是我的文件和目录结构
blog
├── apps
│ ├── homepage
│ │ ├── __init__.py
│ │ ├── models.py
│ │ ├── tests.py
│ │ ├── urls.py
│ │ └── views.py
│ └── __init__.py
├── blog
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── custom
│ └── __init__.py
├── data.db
├── manage.py
├── static
│ ├── css
│ ├── img
│ ├── js
│ ├── restricted
│ └── upload
└── templates
有人可以帮我理解我能做些什么来解决这个错误吗?