【发布时间】:2011-01-08 01:58:21
【问题描述】:
我有一个 urls.py。其中一位说这行:
(r'^notification/?$',include("notification.urls")),
我应该这样做,因为我在 INSTALLED_APPs 中安装了“django_notification”(并添加了“通知”)。
太棒了!去 /notification/ 工作!这是通知模块中的urls.py:
from django.conf.urls.defaults import *
from notification.views import notices, mark_all_seen, feed_for_user, single, notice_settings
urlpatterns = patterns('',
url(r'^$', notices, name="notification_notices"),
url(r'^settings/$', notice_settings, name="notification_notice_settings"),
url(r'^(\d+)/$', single, name="notification_notice"),
url(r'^feed/$', feed_for_user, name="notification_feed_for_user"),
url(r'^mark_all_seen/$', mark_all_seen, name="notification_mark_all_seen"),
)
但是,只有 /notification 有效,当我点击该网址时,它会显示“通知”一词。没有其他工作。 /设置,/饲料。这些都不起作用。我收到一个 404 错误,Django 按顺序尝试了所有 URL。
也许是因为“notification_notice”这件事??
【问题讨论】:
标签: python django templates url notifications