- Author:
- coleifer
- Posted:
- July 3, 2011
- Language:
- Shell
- Version:
- Not specified
- Score:
- 1 (after 1 ratings)
Searches through templates, adding the {% csrf_token %}
tag whenever it finds a form that posts.
1 2 3 | find . -type f -name "*.html" -exec sed -i \
's|\(<form[^>]*method="post"[^>]*>\)\({% csrf_token %}\)\?|\1{% csrf_token %}|g' \
{} \;
|
More like this
- the steps of migration using south in Django... by lockys 10 years, 3 months ago
- One line SMTP sink server by Baguage 10 years, 4 months ago
- Virtualfish Hook by HubertGrzeskowiak 10 years, 6 months ago
- How to rename processes by diverman 13 years, 1 month ago
Comments
That's very cool! I've been trying to do this for a while, without good results.
#
Great post, thanks!
#
Please login first before commenting.