Setting global attributes in Flask framework

flask, python

Solution

Within a request context (i.e. in a view/handler) you can access the config on the `current_app`

from flask import current_app
current_app.config['attribute_name']

Problem

I am working on a small web project using Flask/Python. This is a simple client side application without database. I want to set the REST service address as a global attribute, but haven't figured out how to do that. I know that attributes can be seted in flask.config like this: ``` app = Flask(__name__) app.config['attribute_name'] = the_service_address ``` but the Blueprint module cannot access the 'app' object. Thanks a lot for your time.

Original source