에 전체 URL을 표시되지 않는 것은 이것은 내가 메일로 보내려면이 사용하던역 URL이 장고
#Send mail to admin
admin_subject = "New question added"
admin_message = "A new question has been successfully added. Please review and approve it."
url = reverse("admin:appname_question_change", args=(new_question.pk,))
admin_html_message = "<h3>%s</h3>\
<p>%s</p>\
<a href='%s'>%s</a>" % (admin_subject, admin_message, url, url)
내 코드입니다. 내 메일에 전체 URL이 표시되기 전에
http://192.168.1.0:8000/admin/appname/answer/12
좋아하지만 지금은 내가 아무것도 변경하지 않은 /admin/appname/answer/12
같은 경로를주고는 다른 뷰에 대한 동일한 코드를 추가했다.
내 새로운 코드 :
unbound method build_absolute_uri() must be called with HttpRequest instance as first argument (got str instance instead)
'reverse' 절대 절대 URL을 생성하지 않습니다. 다른 이메일 템플릿이나 '역방향'기능을 사용하여 이전에 URL을 만드셨습니까? –
예 '역방향'기능을 사용하고있었습니다. –