当urlconf不为空时,Django抛出NoReverseMatch错误?

当urlconf不为空时,Django抛出NoReverseMatch错误?,django,django-urls,Django,Django Urls,在我的主urlconf中,我包含了一个应用程序的urlconf: url(r"^items/$", include("items.urls")), 在items/url.py中,我有: urlpatterns = patterns("", url(r"^profile/", ProfileView.as_view(), name="accounts_profile"), url(r"^$", DashboardView.as_view(), name="items_home")

在我的主urlconf中,我包含了一个应用程序的urlconf:

url(r"^items/$", include("items.urls")),
items/url.py
中,我有:

urlpatterns = patterns("",
    url(r"^profile/", ProfileView.as_view(), name="accounts_profile"),
    url(r"^$", DashboardView.as_view(), name="items_home"),
)
问题是,无论我在urlconf中输入什么——除了
r“^$”
——我都会在通过
{%url accounts\u profile%}
调用其中一个urlconf的模板中得到一个
NoReverseMatch
错误。我试过使用不同应用程序的不同视图、不同的urlconf名称等,但没有成功。有什么想法吗


我正在使用Django 1.3.1,FWIW。

没关系,我明白了——问题在于上面的import语句中的
$
符号,它表示行的结束。感觉很傻-/

即将单击“发布您的答案”=p。您可能还想使用r“^profile/$”