Skip to main content

Upload file 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.

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() }}

You can assign the version of Dropzone.js through version argument, the default value is 5.1.1. Step 3: Creating a Drop Zone with create():

{{ dropzone.create(action_view='upload_view') }}

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 Github page , 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.

Source Distribution

Flask-Dropzone-1.4.2.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

Flask_Dropzone-1.4.2-py2.py3-none-any.whl (6.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file Flask-Dropzone-1.4.2.tar.gz.

File metadata

File hashes

Hashes for Flask-Dropzone-1.4.2.tar.gz
Algorithm Hash digest
SHA256 7fadfda1dc42976c06f52c47c5053ecef57ca4f991e4e4dd520e965bc555e362
MD5 af1f7b8ef81a04a3ce708d346ba59bf6
BLAKE2b-256 6c0131cbbc15aa1509af7522e0da4e76c0f24cd1e7bb8307ad4c1693d6560ccc

See more details on using hashes here.

File details

Details for the file Flask_Dropzone-1.4.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_Dropzone-1.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6acf02a7883d3e2b6fc23bcc447a3fc6e0cc145b4e68359d448eb282c112f1f9
MD5 a8045ce4c67dc7eefa9081f1bd4db312
BLAKE2b-256 cda47cfffa42f9b035ab45d60eb758ed7f17d3c2700bc442e3b4b79fc79dff82

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page