Django 管理员因引导失败 "danger" class?
Django admin fails with bootstraps "danger" class?
在我的 django 管理中,错误消息(使用消息框架)是使用 danger
class 创建的。然而,消息看起来是绿色的,上面有一个批准标志:
查看 admin/css/base.css
时,错误 class 似乎是 error
而不是 danger
。
为什么显示为danger
?我该如何更改它?
没有名为危险的消息级别。您可以使用 warning
或 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
在我的 django 管理中,错误消息(使用消息框架)是使用 danger
class 创建的。然而,消息看起来是绿色的,上面有一个批准标志:
查看 admin/css/base.css
时,错误 class 似乎是 error
而不是 danger
。
为什么显示为danger
?我该如何更改它?
没有名为危险的消息级别。您可以使用 warning
或 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