问题是网址.pydjango项目中的文件如下所示:
urlpatterns = patterns('',
...
url(r'^admin/', include(admin.site.urls)),
url(r'^testapp/', include('testapp.urls')), #Here is the problem.
)
我安装了一个应用程序,叫做“testapp”,所以我在模式中写了include('testapp.urls')
。在
问题是,我为什么要在引号中加testapp.urls
?
因为我试着这样说:url('r^testapp/', include(testapp.urls))
,它没用。
为什么?在
ad3w已经回答了你的问题。如果您想了解更多关于它的信息,请查看:http://www.djangobook.com/en/2.0/chapter08/
你必须在中导入应用程序网址.py在
^{1}$相关问题 更多 >
编程相关推荐