我用这个: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个文件:
这些文件现在是空白的。他们只是随便说一句话。在
为什么我尝试发送通知时会出现此错误?在
^{pr2}$
您需要在
urls.py
文件中创建一个条目,包括django-nofication urls.py file:有关包含其他
urls.py
文件的更多信息,请参见Django docs。在你包括正确的网址配置吗?看来Django在你的任何urlconfs中都找不到通知通知。。。在
https://github.com/pinax/django-notification/blob/master/notification/urls.py
你应该在你网站的网址.py,例如:
相关问题 更多 >
编程相关推荐