如何使用render_to_string時填充{%csrf_token%}

我須要使用render_to_string,但不能使用html {%csrf_token%} 並經過python content = render_to_string('blog/comment.html', context=context) return JsonResponse({'content': content}) 解決方案 我已經解決了這個問題,可是我仍然很是想要一個好的解決方案。s
相關文章
相關標籤/搜索