Flask-Web-App-Tutorial
Flask-Web-App-Tutorial copied to clipboard
accessing app.config from init.py in views.py
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