0

文字列として表示されるのではなく、html シーケンスを HTML でレンダリングする必要があります。

Views.py -

from django.utils.html import escape
ret_html = """<p> Please click the following link 
to authorize the application - <a href='""" + auth_url + """' target='_blank'>Authorize!</a> </p>"""
            return HttpResponse(escape(ret_html))

上記はブラウザでこのように正確にレンダリングされます -

<p> Please click the following link to authorize the application - <a href='/social/addtwitter/' target='_blank'>Authorize!</a> </p>

私はそれがこのように見えるようにしたいのですが -

アプリケーションを承認するには、次のリンクをクリックしてください - [Authorize!][1]

文字列をhtmlとしてレンダリングするために、いくつかの調整を行うことができます。

PS : 私は認識しておりrenderrender_to_response

4

1 に答える 1