skip to navigation
skip to content

Not Logged In

Flask-Cors 1.1

A Flask extension adding a decorator for CORS support

Latest Version: 1.3.0

Flask-CORS is a simple extension to Flask allowing you to support cross origin resource sharing (CORS) using a simple decorator.

Build Status

Installation

Install the extension with using pip, or easy_install.

$ pip install flask-cors

Usage

This extension exposes a simple decorator to decorate flask routes with. Simply add @cross_origin() below a call to Flask's @app.route(..) incanation to accept the default options and allow CORS on a given route.

Simple Usage

@app.route("/")
@cross_origin() # allow all origins all methods.
def helloWorld():
  return "Hello, cross-origin-world!"

For a full list of options, please see the documentation.

 
File Type Py Version Uploaded on Size
Flask-Cors-1.1.tar.gz (md5) Source 2013-12-24 8KB
  • Downloads (All Versions):
  • 117 downloads in the last day
  • 2186 downloads in the last week
  • 4037 downloads in the last month