Forbidden (403) : CSRF verification failed. Request aborted.

2021. 4. 10. 23:42파이썬/Django

Forbidden (403)
CSRF verification failed. Request aborted.

You are seeing this message because this site requires a CSRF cookie when submitting forms. This cookie is required for security reasons, to ensure that your browser is not being hijacked by third parties.

If you have configured your browser to disable cookies, please re-enable them, at least for this site, or for “same-origin” requests.

POST 방식에서는 아래 코드를 넣어줘야 처리됨

<form method="POST" action="{% url 'mp3:download' %}">
    {% csrf_token %}
</form>