this part of the code looks fine from a first look. Can you share the
complete view code for this

On Fri, 6 May 2022 at 12:11, Salima Begum <[email protected]>
wrote:

> Hi all,
> In my project I am Django messages Framework. I am always facing 'str'
> object error I dont understand how to solve this problem. Previously also I
> face same issue. Now it is reproduced.
> I am using django 4.0.4 version.
>  Python 3.9.6
> ```
>    messages.success(request, "Welcome back")
> ```
> ```
>     {% if messages %}
>     {% for message in messages %}
>         <div class = "conf_body">
>             <div class="alert alert-{% if message.tags == 'error'
> %}danger{% else %}{{ message.tags }}{% endif %} success-alert flex-row">
>                 <a class="close close_conf" href="#" data-dismiss="alert"
> style="">×</a>
>                 {% if message.tags == 'error' %}
>                 <i style="color:red;" class="fa fa-exclamation-circle
> circle_post"
>                    aria-hidden="true"></i>&nbsp;&nbsp;&nbsp;
>                 <span class="conf_text text_post" style="color:red;">{{
> message|safe }}&nbsp;&nbsp;</span>
>                 {% else %}
>                 <i style="color:#01ABAA;" class="fa fa-check-circle
> circle_post " aria-hidden="true">&nbsp;</i>
>                 <span class = "conf_text"
> style="color:#01ABAA;">&nbsp;&nbsp;&nbsp;{{ message|safe
> }}</span>&nbsp;&nbsp;
>                 {% endif %}
>             </div>
>         </div>
>     {% endfor %}
>     {% endif %}
> ```
>
> Please help me to solve this issue.
>
> Thanks
> ~Salima
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMSz6bkPYRUwSidJd1ay-q-GdeM5Q8CKqY%2BnYU3j7wk%2BEAmYOQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMSz6bkPYRUwSidJd1ay-q-GdeM5Q8CKqY%2BnYU3j7wk%2BEAmYOQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGp2JVFj6DZ74w_Fv1an8SwtoDReG7YseridBDJ1PScuKdwUoQ%40mail.gmail.com.

Reply via email to