Custom error message in Django admin actions

The message_user function used within the admin simply uses the contrib.messages package. You could try something like this:

from django.contrib import messages

# Then, when you need to error the user:
messages.error(request, "The message")

You can also use warning, debug, info and success in place of error

Hope that helps!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)