Skip to main content

Flask-Download-Btn defines a SQLALchemy Mixin for creating Bootstrap download buttons in a Flask application.

Project description


Flask-Download-Btn defines a SQLALchemy Mixin for creating Bootstrap download buttons in a Flask application.

Its key features are:

  1. Automatic enabling and disabling: A download button is automatically disabled on click and re-enabling on download completion.
  2. Web form handling: Applications can modify a download button on click based on web form responses.
  3. Progress bar: Download buttons report progress using a progress bar updated with server-sent events.

Example: Basic use

Suppose we want to include a download button which downloads hello_world.txt accessible at HELLO_WORLD_URL. On click, we want to disable the button and re-enable it when the file finishes downloading.

After setup, we can achieve this with the following:

def index():
    btn = get_btn('basic')
    if not btn:
        btn = DownloadBtn()
        btn.downloads = [(HELLO_WORLD_URL, 'hello_world.txt')]
        add_to_session(btn, 'basic')
    return render_template('index.html', download_btn=btn)


You can find the latest documentation at


Publications which use this software should include the following citation for SQLAlchemy-Function and its dependencies, SQLAlchemy-Function, SQLAlchemy-Mutable, and SQLAlchemy-MutableSoup:

Bowen, D.S. (2019). Flask-Download-Btn[Computer software].

Bowen, D.S. (2019). SQLAlchemy-Function [Computer software].

Bowen, D.S. (2019). SQLAlchemy-Mutable [Computer software].

Bowen, D.S. (2020). SQLAlchemy-MutableSoup [Computer software].

This project is licensed under the MIT License LICENSE.

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-download-btn, version 0.0.17
Filename, size File type Python version Upload date Hashes
Filename, size flask_download_btn-0.0.17-py3-none-any.whl (9.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size flask-download-btn-0.0.17.tar.gz (7.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page