2011-01-07 24 views
2

저는 이것을 사용하고 있습니다 : 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", {}) 

당연히 내 서식 파일 디렉토리에서 나는 의사가 말하는 것처럼 "알림"을 만들었습니다. 이 파일은 지금 비어있는

full.html, 된 통지,

  • full.txt, short.txt : /templates/notification/comment_received 내부

    , 나는 4 개 파일이 있습니다. 그들은 단지 임의의 문장을 말합니다.

    알림을 보내려고 할 때 왜이 오류가 발생합니까?

    Exception Type: NoReverseMatch at/
    Exception Value: Reverse for 'notification_notices' with arguments '()' and keyword arguments '{}' not found. 
    

답변

5

올바른 URL 구성을 포함 했습니까?

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

당신은 만들어야합니다 : 예 ... 당신의 URLconf는 어떤에서 notification_notices을 찾을 수 없습니다 장고처럼 보이는

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

당신은 사이트의 urls.py에서 다음을 참조해야합니다 django-nofication urls.py file 포함하여 urls.py 파일의 항목 :

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

Django docs 개월에 대한 참조 다른 urls.py 파일을 포함하는 정보.