Best Flask open-source libraries and packages

Dfile

[Python + Flask] DFile: A fancy S3-based file sharing mode
Updated 4 months ago

[Python] DFile: A fancy S3-based file sharing mode

Codacy Badge

This is a no-bullshit and S3-based file hosting that also runs on https://dfile.app

img

DFile backend (api)

Before running the service for the first time, run

cp config.sample config.py

Modify config.py (mainly setup your S3)

DOMAIN = "http://localhost:5000"
S3_REGION = "<s3 region>"
S3_ENDPOINT = "https://s3-domain.com"
S3_KEY = "<your s3 key>"
S3_SECRET = "<your s3 secret>"

Run it

python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt
export FLASK_APP=app
export FLASK_ENV=development
export FLASK_DEBUG=1
flask run --host 0.0.0.0 --port 5000

DFile frontend (app)

Install yarn first: https://yarnpkg.com/lang/en/docs/install/

# run
cd app
yarn
yarn dev

# export to production
yarn export

How to use

# Upload using cURL
➜ curl -F file=@yourfile.png https://dfile.herokuapp.com
https://dfile.app/d/F5r3yiDM.png

# Download the file
➜ curl -L https://dfile.app/d/F5r3yiDM.png -o xxx.png

Release History