我尝试使用print方法在django admin中显示消息,但不显示消息。
你能帮我用Django admin在条件下显示消息吗?
答案 0 :(得分:0)
在django中显示消息
messages.debug(request, '%s SQL statements were executed.' % count)
messages.info(request, 'Three credits remain in your account.')
messages.success(request, 'Profile details updated.')
messages.warning(request, 'Your account expires in three days.')
messages.error(request, 'Document deleted.')
您需要学习django message docs