Why am I getting this Error in Django notification?
I'm using this one: https://github.com/pinax/django-notification/blob/master/docs/usage.txt
So, I followed all the steps.
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 notif开发者_高级运维ication.
notification.send(request.user, "comment_received", {})
Of course, in my template directory, I created "notification", just like the doc says.
Inside /templates/notification/comment_received
, I have 4 files:
- full.txt, short.txt, notice.html, full.html
These files are blank right now. They just say a random sentence.
Why am I getting this error when I try to send the notification?
Exception Type: NoReverseMatch at /
Exception Value: Reverse for 'notification_notices' with arguments '()' and keyword arguments '{}' not found.
Did you include the proper URL configurations? Looks like Django can't find notification_notices in any of your urlconfs...
https://github.com/pinax/django-notification/blob/master/notification/urls.py
You should reference these in your site's urls.py, e.g.:
urlpatterns = patterns('',
(r'^notification/', include(notification.urls)),
...
You will need to create an entry in your urls.py
file including the django-nofication urls.py file:
(r'^notifications/', include('notification.urls')),
See the Django docs for more information on including other urls.py
files.
精彩评论