helloflask / helloflask/bootstrap-flask

CSRF Token handling unclear

Open
#147 0 comments 0 reactions 0 assignees View on GitHub
form
Dominant language
SCSS
Stars
1.2k
Forks
193
Avg merge
4m
Merged PRs (30d)
3

Description

To get CSRF Token handling as outline in https://flask-dropzone.readthedocs.io/en/latest/advanced.html
I tried:

```python
# enable CSRF protection
self.app.config['DROPZONE_ENABLE_CSRF'] = True
```
```html

Dropzone.options.myDropzone.headers = {"X-CSRF-Token": "{{ csrf_token() }}"}

Upload Form


{{ render_form(upload_form) }}
{{ dropzone.create(action=url_for('test_upload')) }}
{{ dropzone.config() }}
```

but still i get:
400 Bad Request

Bad Request

The CSRF token is missing.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.