On the page of Django project, when submitting the form post request, an error will be reported: CSRF verification failed. Request aborted
You need to add: {% CSRF} to the form_ Token%} can be solved
Such as
1 <form action="" method="post" enctype="multipart/form-data">
2 {% csrf_token %}
3 <div>
4 import Exl<input type="file" name="exl_obj">
5 <input type="submit" value="upload to server">
6 </div>
7 </form>
Similar Posts:
- [Solved] Forbidden (403) CSRF verification failed. Request aborted.
- [Django CSRF tutorial] solve the problem of forbidden (403) CSRF verification failed. Request aborted
- Spring MVC upload file error string cannot be converted to multipartfile
- Forbidden (CSRF token missing or incorrect.):
- HTTP status 405 – request method ‘get’ not supported using springmvc
- Files Upload Error: err_cert_common_name_invalid [How to Solve]
- Postman reported an error unsupported media type [How to Solve]
- Ajax submitting datagram in firebox_ ERROR_ DOCUMENT_ NOT_ Cached error
- Axios Uploading images appears in the background the request was rejected because no multipart boundary was found
- PHP use$_ SERVER[‘PHP_ Self ‘] to get the current page address and its security issues