[英]Why am I getting this Error in Django notification?
我正在使用这个: https : //github.com/pinax/django-notification/blob/master/docs/usage.txt
所以,我遵循了所有步骤。
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", {})
当然,在我的模板目录中,我创建了“通知”,就像文档说的那样。
在/templates/notification/comment_received
,我有4个文件:
这些文件现在是空白的。 他们只是随便说一句话。
我尝试发送通知时为什么会收到此错误?
Exception Type: NoReverseMatch at /
Exception Value: Reverse for 'notification_notices' with arguments '()' and keyword arguments '{}' not found.
您是否包含正确的URL配置? 看起来Django在你的任何urlconf中都找不到notification_notices ...
https://github.com/pinax/django-notification/blob/master/notification/urls.py
您应该在您网站的urls.py中引用这些内容,例如:
urlpatterns = patterns('',
(r'^notification/', include(notification.urls)),
...
您需要在urls.py
文件中创建一个包含django-nofication urls.py文件的条目:
(r'^notifications/', include('notification.urls')),
有关包含其他urls.py
文件的更多信息,请参阅Django文档 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.