diff --git a/app.py b/app.py index 36047425c..15eb0a27b 100644 --- a/app.py +++ b/app.py @@ -106,6 +106,11 @@ for handler in logging.getLogger().handlers: app.request_class = RequestWithId +# Generate a secret key if none was specified. +if app.config['SECRET_KEY'] is None: + logger.debug('Generating in-memory secret key') + app.config['SECRET_KEY'] = generate_secret_key() + features.import_features(app.config) Principal(app, use_sessions=False) @@ -144,11 +149,6 @@ database.configure(app.config) model.config.app_config = app.config model.config.store = storage -# Generate a secret key if none was specified. -if app.config['SECRET_KEY'] is None: - logger.debug('Generating in-memory secret key') - app.config['SECRET_KEY'] = generate_secret_key() - @login_manager.user_loader def load_user(user_uuid): logger.debug('User loader loading deferred user with uuid: %s' % user_uuid)