Skip to content
A micropub media endpoint written in Python using Flask and Flask-HashFS
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spano Send response body as JSON Jan 17, 2019
.gitignore
LICENSE Create LICENSE Jun 6, 2019
README.md
requirements.txt flask to 0.12.3 Jan 17, 2019
run.py Missed a rename in run.py Jan 26, 2017
spano.cfg.template Rename to Spano Jan 26, 2017
spano.wsgi

README.md

Spano

A minimum viable Micropub Media Endpoint implementation built on Python, Flask and Flask-HashFS. Uses Flask-IndieAuth to support authentication with IndieAuth.

Quick (& Dirty) Start

How to run your own instance of Spano.

git clone https://github.com/martymcguire/spano.git
cd spano

Create and activate a virtualenv:

virtualenv --python=/usr/bin/python3 venv
source venv/bin/activate

or conda:

conda create -n spano python=3.5
source activate spano

Install required Python libraries

pip install -r requirements.txt

Copy spano.cfg.template to spano.cfg and edit it to check the values of ME, TOKEN_ENDPOINT

Run the dev server

python run.py

You can test out the server with curl, but you'll need a valid IndieAuth token to authenticate. One way to get one is to log in with Quill and visit the Quill settings page, where you can copy the access token.

To perform a test upload with curl:

curl -D - -F "file=@myfile.jpg" \
  -H"Authorization: Bearer xxxx..." \
  localhost:5000/

You should see output like:

HTTP/1.1 100 Continue

HTTP/1.0 201 CREATED
Content-Type: text/html; charset=utf-8
Content-Length: 108
Location: http://localhost:5000/cc/a5/97/7c/20049317385a31319590e39c8693638bb368767a76faf0735b6dd2cb.jpg
Server: Werkzeug/0.11.4 Python/2.7.11
Date: Thu, 26 Jan 2017 02:40:05 GMT

File created: http://localhost:5000/cc/a5/97/7c/20049317385a31319590e39c8693638bb368767a76faf0735b6dd2cb.jpg

Deployment

Spano needs a webserver like Apache or nginx for serving the actual file content, and to act as a proxy for virtualhost support, HTTPS, etc.

These instructions are generic but hopefully a good starting place:

The Name?

Jessie Spano was the most organized character on Saved by the Bell and the only one I would trust to keep my files in order.

You can’t perform that action at this time.