Ticket #15055: django15055.formsdocs.diff
File django15055.formsdocs.diff, 1.1 KB (added by , 14 years ago) |
---|
-
docs/topics/forms/index.txt
173 173 context variable ``form``. Here's a simple example template:: 174 174 175 175 <form action="/contact/" method="post"> 176 {% csrf_token %} 176 177 {{ form.as_p }} 177 178 <input type="submit" value="Submit" /> 178 179 </form> … … 180 181 The form only outputs its own fields; it is up to you to provide the surrounding 181 182 ``<form>`` tags and the submit button. 182 183 184 .. admonition:: Forms and Cross Site Request Forgery protection 185 186 Django ships with an easy-to-use :doc:`protection against Cross Site Request 187 Forgeries </ref/contrib/csrf>` in forms. This protection is manifested by 188 the :ttag:`crsf_token` template tag in this example. For sake of purely 189 explaining using forms in templates, this tag is not displayed in further 190 examples in this document. 191 183 192 ``form.as_p`` will output the form with each form field and accompanying label 184 193 wrapped in a paragraph. Here's the output for our example template:: 185 194