V
V
Val1n0r2019-11-13 19:35:04
Django
Val1n0r, 2019-11-13 19:35:04

How to insert an image in django.messages?

Actually the question is in the title
There are messages displayed by the condition

if bow_buy_status:
            messages.add_message(request, messages.INFO, "Купили лук <img src='{% static'img/bow'> %}' <br> Урон:{}".format(BowPwr),extra_tags='safe')
            return redirect('BuyBowPage')

I tried in different ways, changed quotes, brackets, etc., it doesn’t work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-11-13
@devildayne

No way, the messages framework is not designed for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question