为什么我在Django通知中得到这个错误?

2024-05-12 20:36:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我用这个: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", {})

当然,在我的模板目录中,我创建了“通知”,正如doc所说。在

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

  • 在全文.txt, 短.txt, 通知.html, 完整.html在

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

为什么我尝试发送通知时会出现此错误?在

^{pr2}$

Tags: 文件thedjangohttpsgithubtxtcomsend
2条回答

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

(r'^notifications/', include('notification.urls')),

有关包含其他urls.py文件的更多信息,请参见Django docs。在

你包括正确的网址配置吗?看来Django在你的任何urlconfs中都找不到通知通知。。。在

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

你应该在你网站的网址.py,例如:

urlpatterns = patterns('',
    (r'^notification/', include(notification.urls)),
...

相关问题 更多 >