1

在我的 django admin 中,错误消息(使用消息框架)是使用danger类创建的。但是,该消息看起来是绿色的,上面有一个批准标志:

在此处输入图像描述

调查时admin/css/base.css,看起来错误类是error而不是danger

为什么显示为danger?我怎样才能改变它?

4

1 回答 1

3

没有称为危险的消息级别。您可以使用的是warningor 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
于 2017-05-22T01:30:48.690 回答