Flask-Web-App-Tutorial icon indicating copy to clipboard operation
Flask-Web-App-Tutorial copied to clipboard

accessing app.config from init.py in views.py

Open gemin55 opened this issue 2 years ago • 0 comments

Hi Tim, I am trying to access the app.config from init.py in views.py but it is not recognising app.config I am using the same file structure as you. I just want to access the app.config in views.py. Do i need to import something?

in init.py def create_app(): app = Flask(name) app.config['SECRET_KEY'] = 'xftry' app.config['UPLOAD_FOLDER'] = myfolder

In views.py: (not recognising app) f.save(os.path.join(app.config['UPLOAD_FOLDER'], f.filename))

Thank you

gemin55 avatar Mar 30 '22 18:03 gemin55