Skip to content

Flask Extension implementing the Tus.io server side resumable upload protocol

License

Notifications You must be signed in to change notification settings

jzwolak/Flask-Tus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-Tus

Flask Extension implementing the Tus.io server protocol

As of May, 2020, I am using this code in a production enterprise application running on Google Compute Engine with Uppy as the frontend (Javascript client). YMMV, but I'm confident this can work. The code could use some work, but it does in fact work.

Prerequisites (redis)

Currently flask-tus is reliant on a local redis server. This is used for caching information about uploads in progress. It is on the roadmap to remove this dependancy. You must install the redis python package for this extension to work.

pip install redis

Installation

Installation from source (this repository)

python setup.py install

Installation from PyPi repository (recommended for latest stable release)

pip install Flask-Tus

Usage

demo.py

from flask import Flask, render_template, send_from_directory
from flask_tus import tus_manager
import os

app = Flask(__name__)
tm = tus_manager(app, upload_url='/file-upload', upload_folder='uploads/')

tus_manager() registers two new url endpoint /file-upload and /file-upload/<resource>. You can not define views for those urls in your app. Simply use any tus client and point it to /file-upload as the endpoint

Building (local instructions for me
  1. python setup.py sdist
  2. twine upload

About

Flask Extension implementing the Tus.io server side resumable upload protocol

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 50.2%
  • Python 42.6%
  • HTML 6.9%
  • CSS 0.3%