1 {% load comments %} 2 <form method="POST" action="{% comment_form_target %}" class="comment_form"> 3 {% csrf_token %} 4 <dl> 5 <dt class="comment_user"> 6 {{ user.username }} 7 </dt> 8 <dd class="comment_content"> 9 {{ form.comment }} 10 <input type="submit" class="eng button" value="Comment"/> 11 </dd> 12 </dl> 13 {{ form.content_type }} 14 {{ form.object_pk }} 15 {{ form.timestamp }} 16 {{ form.security_hash }} 17 <input type="hidden" name="next" value="{{ request.get_full_path }}"/> 18 </form>csrf_token ์ ์ด๋์๋๋ฐ๋ ๊ณ์ ์ด๋ฐ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.ใ์ด๋ป๊ฒ ํด์ผ๋ ๊น์ ใ ใ
--
Google ๊ทธ๋ฃน์ค 'Django-ko' ๊ทธ๋ฃน์ ๊ฐ์ ํ์ผ๋ฏ๋ก ๋ณธ ๋ฉ์ผ์ด ์ ์ก๋์์ต๋๋ค.
์น์์ ์ด ํ ๋ก ์ ๋ณด๋ ค๋ฉด https://groups.google.com/d/msg/django-ko/-/0tOpErF5dvAJ์(๋ฅผ) ๋ฐฉ๋ฌธํ์ธ์.
์ด ๊ทธ๋ฃน์ ๊ฒ์ํ๋ ค๋ฉด djan...@googlegroups.com(์ผ)๋ก ์ด๋ฉ์ผ์ ๋ณด๋ด์ธ์.
๊ทธ๋ฃน์์ ํํดํ๋ ค๋ฉด django-ko+...@googlegroups.com๋ก ์ด๋ฉ์ผ์ ๋ณด๋ด์ฃผ์ธ์.
๋ ๋ง์ ์ต์ ์ ๋ณด๋ ค๋ฉด http://groups.google.com/group/django-ko?hl=ko์์ ๊ทธ๋ฃน์ ๋ฐฉ๋ฌธํ์ธ์.
์น์์ ์ด ํ ๋ก ์ ๋ณด๋ ค๋ฉด https://groups.google.com/d/msg/django-ko/-/4zcUSpn75pYJ์(๋ฅผ) ๋ฐฉ๋ฌธํ์ธ์.
์ด ๊ทธ๋ฃน์ ๊ฒ์ํ๋ ค๋ฉด djan...@googlegroups.com(์ผ)๋ก ์ด๋ฉ์ผ์ ๋ณด๋ด์ธ์.
๊ทธ๋ฃน์์ ํํดํ๋ ค๋ฉด django-ko+...@googlegroups.com๋ก ์ด๋ฉ์ผ์ ๋ณด๋ด์ฃผ์ธ์.
๋ ๋ง์ ์ต์ ์ ๋ณด๋ ค๋ฉด http://groups.google.com/group/django-ko?hl=ko์์ ๊ทธ๋ฃน์ ๋ฐฉ๋ฌธํ์ธ์.
Forbiddenย (403)
CSRF verification failed. Request aborted.
Help
Reason given for failure:
CSRF token missing or incorrect.In general, this can occur when there is a genuine Cross Site Request Forgery, or whenย Django's CSRF mechanismย has not been used correctly. For POST forms, you need to ensure:
- Your browser is accepting cookies.
- The view function usesย
RequestContextย for the template, instead ofยContext.- In the template, there is aย
{% csrf_token %}ย template tag inside each POST form that targets an internal URL.- If you are not usingย
CsrfViewMiddleware, then you must useยcsrf_protectย on any views that use theยcsrf_tokenย template tag, as well as those that accept the POST data.You're seeing the help section of this page because you haveย
DEBUG = Trueย in your Django settings file. Change that toยFalse, and only the initial error message will be displayed.You can customize this page using the CSRF_FAILURE_VIEW setting.
MIDDLEWARE_CLASSES = (
ย ย .....
ย ย 'django.middleware.csrf.CsrfViewMiddleware',
ย ย ...
}
--
Google ๊ทธ๋ฃน์ค 'Django-ko' ๊ทธ๋ฃน์ ๊ฐ์ ํ์ผ๋ฏ๋ก ๋ณธ ๋ฉ์ผ์ด ์ ์ก๋์์ต๋๋ค.
์น์์ ์ด ํ ๋ก ์ ๋ณด๋ ค๋ฉด https://groups.google.com/d/msg/django-ko/-/mKbLURqPjWMJ์(๋ฅผ) ๋ฐฉ๋ฌธํ์ธ์.
์ด ๊ทธ๋ฃน์ ๊ฒ์ํ๋ ค๋ฉด djan...@googlegroups.com(์ผ)๋ก ์ด๋ฉ์ผ์ ๋ณด๋ด์ธ์.
๊ทธ๋ฃน์์ ํํดํ๋ ค๋ฉด django-ko+...@googlegroups.com๋ก ์ด๋ฉ์ผ์ ๋ณด๋ด์ฃผ์ธ์.
๋ ๋ง์ ์ต์ ์ ๋ณด๋ ค๋ฉด http://groups.google.com/group/django-ko?hl=ko์์ ๊ทธ๋ฃน์ ๋ฐฉ๋ฌธํ์ธ์.