Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove suggestion to use flask.ext.cors, favor flask_cors #162

Merged
merged 1 commit into from
Jun 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Install the extension with using pip, or easy\_install.
Usage
-----

This package exposes a Flask extension which by default enables CORS support on all routes, for all origins and methods. It allows parameterization of all CORS headers on a per-resource level. The package also contains a decorator, for those who prefer this approach.
This package exposes a Flask extension which by default enables CORS support on all routes, for all origins and methods. It allows parameterization of all CORS headers on a per-resource level. The package also contains a decorator, for those who prefer this approach.

Simple Usage
~~~~~~~~~~~~

In the simplest case, initialize the Flask-Cors extension with default
arguments in order to allow CORS for all domains on all routes. See the
full list of options in the `documentation <http://flask-cors.corydolphin.com/en/latest/api.html#extension>`__.
Expand All @@ -41,7 +41,7 @@ full list of options in the `documentation <http://flask-cors.corydolphin.com/en


from flask import Flask
from flask.ext.cors import CORS, cross_origin
from flask_cors import CORS, cross_origin

app = Flask(__name__)
CORS(app)
Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cross origins, simply set the `supports_credentials` option to `True`. E.G.


from flask import Flask, session
from flask.ext.cors import CORS
from flask_cors import CORS

app = Flask(__name__)
CORS(app, supports_credentials=True)
Expand Down
4 changes: 2 additions & 2 deletions examples/app_based_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
from flask import Flask, jsonify
import logging
try:
from flask.ext.cors import CORS # The typical way to import flask-cors
from flask_cors import CORS # The typical way to import flask-cors
except ImportError:
# Path hack allows examples to be run without installation.
import os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)

from flask.ext.cors import CORS
from flask_cors import CORS


app = Flask('FlaskCorsAppBasedExample')
Expand Down
4 changes: 2 additions & 2 deletions examples/blueprints_based_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
from flask import Flask, jsonify, Blueprint
import logging
try:
from flask.ext.cors import CORS # The typical way to import flask-cors
from flask_cors import CORS # The typical way to import flask-cors
except ImportError:
# Path hack allows examples to be run without installation.
import os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)

from flask.ext.cors import CORS
from flask_cors import CORS


api_v1 = Blueprint('API_v1', __name__)
Expand Down
4 changes: 2 additions & 2 deletions examples/view_based_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
import logging
try:
# The typical way to import flask-cors
from flask.ext.cors import cross_origin
from flask_cors import cross_origin
except ImportError:
# Path hack allows examples to be run without installation.
import os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)

from flask.ext.cors import cross_origin
from flask_cors import cross_origin


app = Flask('FlaskCorsViewBasedExample')
Expand Down
2 changes: 1 addition & 1 deletion tests/decorator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
Tests particular to flask.ext.cors.cross_origin
Tests particular to flask_cors.cross_origin
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
origin resource sharing (CORS) using a simple decorator.
Expand Down
11 changes: 2 additions & 9 deletions tests/decorator/test_w3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,8 @@

from ..base_test import FlaskCorsTestCase
from flask import Flask

try:
# this is how you would normally import
from flask.ext.cors import *
from flask.ext.cors.core import *
except:
# support local usage without installed package
from flask_cors import *
from flask_cors.core import *
from flask_cors import *
from flask_cors.core import *


class OriginsW3TestCase(FlaskCorsTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/extension/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
Tests particular to flask.ext.cors.CORS
Tests particular to flask_cors.CORS
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
origin resource sharing (CORS) using a simple decorator.
Expand Down