私のユーザは、例えばimage1のように書くことができ、正規表現を使ってそのタグを認識して置き換えることができます。私はそれをすべての作業持っている - しかし、私はディスプレイ用のテンプレートにデータを渡すとき、私はこのようにそれを行う:djangoはviews.pyから渡されるhtmlタグをレンダリングします
<div class="container">
<p>
{% articleTxt %}
</p>
</div>
ArticleTxtが含まれています
This is a test Article <img src="/media/articleImages/django-allauth.png">
and that was a picture and this is another one then some more text ----
original: This is a test Article *image1* and that was a picture and this is
another one *image2* then some more text
を私の欲求不満厥。私もそれは常にそれらをレンダリングするのではなく、タグを出力します
{{% articleTXT|safe %}}
を試してみました
{% autoescape off %} {{articleTXT}} {{% autoescape %}}
:私はにテンプレートを変更しようとしました。 views.pyから渡されたテキストに埋め込まれたタグをレンダリングする方法はありますか?
'articleTXT'の内容を理解していませんか?その「img」または「text」 – Bijoy