Skip to content

Commit c63497d

Browse files
committed
Merge pull request #426 from lhuriguen/patch-1
Escape template tags
2 parents 4d47241 + 9adecfc commit c63497d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

en/django_forms/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ To create a new `Post` form, we need to call `PostForm()` and pass it to the tem
125125

126126
We need to create a file `post_edit.html` in the `blog/templates/blog` directory. To make a form work we need several things:
127127

128-
- we have to display the form. We can do that for example with a simple `{{ form.as_p }}`.
128+
- we have to display the form. We can do that for example with a simple `{% raw %}{{ form.as_p }}{% endraw %}`.
129129
- the line above needs to be wrapped with an HTML form tag: `<form method="POST">...</form>`
130130
- we need a `Save` button. We do that with an HTML button: `<button type="submit">Save</button>`
131131
- and finally just after the opening `<form ...>` tag we need to add `{% raw %}{% csrf_token %}{% endraw %}`. This is very important, since it makes your forms secure! Django will complain if you forget about this bit if you try to save the form:

0 commit comments

Comments
 (0)