In a Django view, I'm placing an Html form (actual string with some Html, from my DB) into an Html template, with a tag: {{ injected_form|safe }}
. This succeeds in showing the form, but I've got an issue POSTing it:
Forbidden (...) CSRF token missing or incorrect.
(Which I know is appropriate Django behaviour, as I have no CSRF token tag/field inside the form itself. Btw the reason for the custom Html form strings in the DB is that they can be produced by the actual user)
A solution I could implement is TheBronx's answer to a question here. This seems to be a case where just doing
<form method="post">
{% csrf_token %}
......
</form>
is not possible! Are there solutions for this issue?
I've figured out how to handle/receive POSTs without a related Django model, but I didn't foresee this CSRF problem submitting them :( Any help would be greatly appreciated