helloflask / flask-dropzone

Upload files in Flask application with Dropzone.js.
https://flask-dropzone.readthedocs.io
MIT License
250 stars 69 forks source link

redirect_view resolving url #22

Closed volzon closed 5 years ago

volzon commented 5 years ago

DROPZONE_REDIRECT_VIEW (redirect_view) use url_for() to resolve the url, but i can not find any way to pass arguments. There is also no way of passing an url.

Suggestion1: use get_url() from utils.py so that its possible to pass complete url or for example '/index/2' this is OK as a quick fix. Must do it both at line 67 and 203

Suggestion2: Fix/Clarify in the docs how to pass arguments with DROPZONE_REDIRECT_VIEW

SoulMUSZE commented 5 years ago

Is there a fix that can be used right now to pass arguments to the redirect view?

greyli commented 5 years ago

You can pass redirect URL directly in template with redirect_url keyword:

{{ dropzone.config(redirect_url=url_for('endpoint', foo=bar)) }}
SoulMUSZE commented 5 years ago

Thanks so much!