首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为什么在Django通知中会出现这个错误?

为什么在Django通知中会出现这个错误?
EN

Stack Overflow用户
提问于 2011-01-07 23:06:52
回答 2查看 747关注 0票数 3

我用的是这个:https://github.com/pinax/django-notification/blob/master/docs/usage.txt

所以,我遵循了所有的步骤。

代码语言:javascript
运行
复制
from notification import models as notification

#first, create the notification type.
notification.create_notice_type("comment_received", ("Comment Received"), ("You have received a comment."))

#then, send the notification. 
notification.send(request.user, "comment_received", {})

当然,在我的模板目录中,我创建了“通知”,就像doc说的那样。

/templates/notification/comment_received中,我有4个文件:

  • full.txt,short.txt,notice.html,full.html

这些文件现在是空白的。他们只是随便说一句。

当我试图发送通知时,为什么会收到这个错误?

代码语言:javascript
运行
复制
Exception Type: NoReverseMatch at /
Exception Value: Reverse for 'notification_notices' with arguments '()' and keyword arguments '{}' not found.
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-01-07 23:12:32

您包括了正确的URL配置吗?看起来Django在你的urlconf中找不到notification_notices ..。

https://github.com/pinax/django-notification/blob/master/notification/urls.py

您应该在站点的urls.py中引用这些内容,例如:

代码语言:javascript
运行
复制
urlpatterns = patterns('',
    (r'^notification/', include(notification.urls)),
...
票数 5
EN

Stack Overflow用户

发布于 2011-01-07 23:13:40

您需要在urls.py文件中创建一个条目,包括django-nofication urls.py文件

代码语言:javascript
运行
复制
(r'^notifications/', include('notification.urls')),

有关包含其他姜戈博士文件的更多信息,请参见urls.py

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4631096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档