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:

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Flask_Dropzone-1.6.0-py2.py3-none-any.whl (23.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: Flask-Dropzone-1.6.0.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.0

File hashes

Hashes for Flask-Dropzone-1.6.0.tar.gz
Algorithm Hash digest
SHA256 9557ce16b07a5c0f4c334c0c9713ca1f0672e55c64aefe6bc055c5e2e391177c
MD5 e642d0f4c229974daeacee3d2414b33b
BLAKE2b-256 dcc117146af35bd74084163511b7349f0f3241f40105a497782f179f891113bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Flask_Dropzone-1.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.0

File hashes

Hashes for Flask_Dropzone-1.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 41242ea2bcdb6059dc56bbaefbbf4a3d5e49e2fa10ea3766cb42f67f671af75b
MD5 4c625898310bebad2e87920cab2a135d
BLAKE2b-256 719adabab96e5df84b445df8e098714f6c05600e19ea4a53e20181e8800de21c

See more details on using hashes here.

Supported by

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