Upload files in Flask with Dropzone.js.
Project description
Flask-Dropzone packages Dropzone.js into an extension to add file upload support for Flask. It can create links to serve Dropzone from a CDN and works with no JavaScript code in your application.
NOTICE: This extension is built for simple usage, if you need more flexibility, please use Dropzone.js directly.
Basic Usage
Step 1: Initialize the extension:
from flask_dropzone import Dropzone
dropzone = Dropzone(app)
Step 2: In your <head> section of your base template add the following code:
<head> {{ dropzone.load_css() }} </head> <body> ... {{ dropzone.load_js() }} </body>
You can assign the version of Dropzone.js through version argument, the default value is 5.2.0. Step 3: Creating a Drop Zone with create(), and configure it with config():
{{ dropzone.create(action='the_url_which_handle_uploads') }} ... {{ dropzone.config() }}
Also to edit the action view to yours.
Beautify Dropzone
Style it according to your preferences through style() method:
{{ dropzone.style('border: 2px dashed #0087F7; margin: 10%; min-height: 400px;') }}
More Detail
Go to Documentation , which you can check for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Flask_Dropzone-1.6.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41242ea2bcdb6059dc56bbaefbbf4a3d5e49e2fa10ea3766cb42f67f671af75b |
|
MD5 | 4c625898310bebad2e87920cab2a135d |
|
BLAKE2b-256 | 719adabab96e5df84b445df8e098714f6c05600e19ea4a53e20181e8800de21c |