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.

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


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

Uploaded Source

Built Distribution

Flask_Dropzone-1.5.4-py2.py3-none-any.whl (23.2 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: Flask-Dropzone-1.5.4.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for Flask-Dropzone-1.5.4.tar.gz
Algorithm Hash digest
SHA256 fddeb963aef31da81e7bc39cad740e8778a8c59d96ef76c7d5ed362fc626a73a
MD5 acddf6444f09bc001ec67fbfb9308238
BLAKE2b-256 bd39f8442a7e858ec52f04deefcdb6c530aca3c92c674432213b6dfecdd41745

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Flask_Dropzone-1.5.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for Flask_Dropzone-1.5.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e5e3d4740d407807aa99d7b6438aad812a1ce01e1b07b0f409462ff078386709
MD5 7967e5c17e1c41659c17e2df8afdfad9
BLAKE2b-256 905975f018b163d9175fb6ab427125c1668e28ec6344735a2d84d84a594cc3ad

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