I want to save a string in the app object like in flask
I expect to save it like
app.config['UPLOAD_FOLDER'] = 'some/path/name_of_folder'
AttributeError: 'FlaskApp' object has no attribute 'config'
app = connexion.App(__name__)
app.add_api('swagger.yaml')
app.config['UPLOAD_FOLDER'] = 'some/path/name_of_folder'
Output of the commands:
Python 3.4.2
connexion -> Version: 1.1.9
You can access it via "connexion.App().app"
Thank you, so the command is:
->$ app.app.config['UPLOAD_FOLDER'] = 'some/path/name_of_folder'
So how do you access the UPLOAD_FOLDER config value in, say, a controller?
@randyesq I did this successfully from a controller file, found under <project>/controllers/default_controller.py:
from flask import current_app
def read(limit=1):
return current_app.config['FOO_BAR']
Most helpful comment
Thank you, so the command is:
->$ app.app.config['UPLOAD_FOLDER'] = 'some/path/name_of_folder'