在我的 django admin 中,错误消息(使用消息框架)是使用danger
类创建的。但是,该消息看起来是绿色的,上面有一个批准标志:
调查时admin/css/base.css
,看起来错误类是error
而不是danger
。
为什么显示为danger
?我怎样才能改变它?
在我的 django admin 中,错误消息(使用消息框架)是使用danger
类创建的。但是,该消息看起来是绿色的,上面有一个批准标志:
调查时admin/css/base.css
,看起来错误类是error
而不是danger
。
为什么显示为danger
?我怎样才能改变它?
没有称为危险的消息级别。您可以使用的是warning
or error
:
https://docs.djangoproject.com/en/1.11/ref/contrib/messages/#message-levels
DEBUG Development-related messages that will be ignored (or removed)
in a production deployment
INFO Informational messages for the user
SUCCESS An action was successful, e.g. “Your profile was updated successfully”
WARNING A failure did not occur but may be imminent
ERROR An action was not successful or some other failure occurred