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.3.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

Flask_Dropzone-1.4.3-py2.py3-none-any.whl (24.2 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for Flask-Dropzone-1.4.3.tar.gz
Algorithm Hash digest
SHA256 f04f04550361eaa497000271ce533896e6df35273d9c95902f92510b794e4c47
MD5 aff30e0aa0fdf76a093f8d93d8bfa642
BLAKE2b-256 5ca31a069f3d3b19b3a250910b0eb696686febaecb637efcba3d40a1c9613ebe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Flask_Dropzone-1.4.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ff17425eddaf08d20d13a4ff006e2e6dc9edf248ac4f59cfe373cc4ee844f933
MD5 e45220ddf07b34e38e1b2539e7a51854
BLAKE2b-256 e5d5365daff2c416722cb8e2168a998fc387e2fa2f3a73d596b97c00da9c3e4b

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