Skip to main content

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:

{{ dropzone.load_css() }}
{{ dropzone.load_js() }}

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:

{{'border: 2px dashed #0087F7; margin: 10%; min-height: 400px;') }}

More Detail

Go to Documentation , which you can check for more details.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Flask-Dropzone, version 1.6.0
Filename, size File type Python version Upload date Hashes
Filename, size Flask_Dropzone-1.6.0-py2.py3-none-any.whl (23.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size Flask-Dropzone-1.6.0.tar.gz (24.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page