Skip to content

Commit

Permalink
restless manager: add app argument to create_api
Browse files Browse the repository at this point in the history
  • Loading branch information
rrader committed Nov 7, 2015
1 parent 77bc2c4 commit 9ff7556
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions project/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
# from ..models import MyModel


def initialize_api():
def initialize_api(app):
# List all Flask-Restless APIs here
# model_api = manager.create_api(MyModel, methods=['GET'])
# model_api = manager.create_api(MyModel, methods=['GET'],
# app=app,
# url_prefix='/api')
pass


api = Blueprint('api', __name__, url_prefix='/api')
api = Blueprint('api', __name__)
8 changes: 4 additions & 4 deletions project/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def create_app(config=None, app_name='project', blueprints=None):

blueprints_fabrics(app, blueprints)
extensions_fabrics(app)
api_fabrics() # this must be called after extensions_fabrics
api_fabrics(api) # this must be called after extensions_fabrics
configure_logging(app)

error_pages(app)
Expand Down Expand Up @@ -79,15 +79,15 @@ def extensions_fabrics(app):
pages.init_app(app)
init_social(app, db)
login_manager.init_app(app)
manager.init_app(app, db)
manager.init_app(app, flask_sqlalchemy_db=db)
migrate.init_app(app, db)
csrf.init_app(app)
cache.init_app(app)
celery.config_from_object(app.config)


def api_fabrics():
initialize_api()
def api_fabrics(app):
initialize_api(app)


def error_pages(app):
Expand Down

0 comments on commit 9ff7556

Please sign in to comment.