Git Product home page Git Product logo

aiohttp-tus's Introduction

aiohttp-tus

CI Workflow pre-commit black Latest Version Python versions BSD License Documentation

tus.io server implementation for aiohttp.web applications.

For uploading large files, please consider using aiotus (Python 3.7+) library instead.

  • Works on Python 3.6+
  • Works with aiohttp 3.5+
  • BSD licensed
  • Latest documentation on Read The Docs
  • Source, issues, and pull requests on GitHub

Quickstart

Code belows shows how to enable tus-compatible uploads on /uploads URL for aiohttp.web application. After upload, files will be available at ../uploads directory.

from pathlib import Path

from aiohttp import web
from aiohttp_tus import setup_tus


app = setup_tus(
    web.Application(),
    upload_url="/uploads",
    upload_path=Path(__file__).parent.parent / "uploads",
)

Chunk Size

Please, make sure to configure client_max_size for aiohttp.web Application and supply proper chunkSize for Uppy.io or other tus.io client.

Documentation

CORS Headers

To setup CORS headers you need to use cors_middleware from aiohttp-middlewares package. aiohttp-cors library not supported cause of aio-libs/aiohttp-cors#241 issue.

Documentation

Reverse proxy and HTTPS

When aiohttp application deployed under the reverse proxy (such as nginx) with HTTPS support, it is needed to use https_middleware from aiohttp-middlewares package to ensure that web.Request instance has proper schema.

Documentation

Examples

examples/ directory contains several examples, which illustrate how to use aiohttp-tus with some tus.io clients, such as tus.py and Uppy.io.

aiohttp-tus's People

Contributors

dependabot[bot] avatar dogfalo avatar oxullo avatar playpauseandstop avatar xen avatar

Forkers

cdiebner

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.