Django - 不支持的格式字符'a'(0x61)

时间:2010-11-14 13:41:14

标签: django

我收到以下错误

unsupported format character 'a' (0x61) at index 16

def send_notification_email(sender, **kwargs):
    change = sender
    print "=========================================="
    mail_admins(subject="model %(model) has been changed by %(user)" % 
                            {'model':change.content_type, 'user': change.user},
                message = render_to_string('change_email.html', { 'change': change }) )

有什么建议吗?

1 个答案:

答案 0 :(得分:9)

您忘记了格式说明符。

%(model)s