Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A port of djangos storages framework for use with flask applications

Project Description
Quickstart
==========

.. include:: header.rst


**1** :ref:`Install Flask-Servatus <installation>` via pip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. sourcecode:: shell

$ pip install Flask-Servatus


**2** :ref:`Initialise <initialise>` and :ref:`configure <configuration>` the ``Servatus`` application object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. sourcecode:: python

from flask import Flask
from flask.ext.servatus import Servatus

app = Flask(__name__)
servatus = Servatus(app)

#.init_app() interface is also availble..

def factory(arg, arg2):

app = Flask(__name__)
servatus = Servatus()
servatus.init_app(app)

return app



**3** Use your prefered :ref:`storages <storages>` object to save files.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. sourcecode:: python

from flask import Flask
from flask.ext.servatus import Servatus
from flask.ext.servatus.files import ContentFile
from flask.ext.servatus.storages import get_default_storage

app = Flask(__name__)
servatus = Servatus(app)

storage = get_default_storage()

@app.route('/uploads', methods=['GET', 'POST'])
def handle_upload():
# handle uploaded file from user subitted form..

storage.save('foo.txt', request.files['file'])
Release History

Release History

This version
History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

History Node

0.0.3

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
flask_servatus-0.1.3.tar.gz (18.2 kB) Copy SHA256 Checksum SHA256 Source Feb 9, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting