Checking message value in Django template

Solution 1:

Just use

{% if message|stringformat:"s" = "Invalid reCAPTCHA. Please try again." %}