Coder Social home page Coder Social logo

flask-ecstatic's Introduction

Serves static files with optional directory index

[Latest Version] (https://pypi.python.org/pypi/Flask-Ecstatic/) [Downloads] (https://pypi.python.org/pypi/Flask-Ecstatic/) [Supported Python versions] (https://pypi.python.org/pypi/Flask-Ecstatic/) [License] (https://pypi.python.org/pypi/Flask-Ecstatic/)

Files in static folder are automatically served on static URL by Flask. See http://flask.pocoo.org/docs/0.10/api/#application-object.

It's recommended to specify static folder and URL path directly on Flask application object, unless you need additional static folders, or have multiple route handlers for the URL path, e.g. when serving static files on root URL ('') for any path unmatched with previous routes.

Supported Platforms

Get Started

Install using pip or easy_install:

pip install Flask-Ecstatic
easy_install Flask-Ecstatic

Example:

Flask application: app.py

#!/usr/bin/env python

"""Flask-based web application."""

__all__ = 'app'.split()

import flask
import flask.ext.ecstatic

app = flask.Flask(__name__, static_folder=None)

# Here initialize your routes, for example an API server on /api/...

# And serve files from `static/` folder for all other URLs.
flask.ext.ecstatic.add(app, '', 'static')

if __name__ == '__main__':
    app.run()

Changelog

0.1.0

  • Initial release.

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.