def populate_settings(app): """ Populates the settings with defaults from the app config. Settings that are already set will not be overridden. Args: app: The Flask app object. """ for setting in app.config['DEFAULT_SETTINGS']: if setting['key'] not in app.config['SETTINGS'].keys(): setting = Setting(**setting) setting.save() app.config['SETTINGS']['installed'] = True