The default name of the database ("mediagoblin") was coded
in db/open.py and init/celery/__init__.py.
Instead use the new config system to have this as the
default for the "db_name" config option.
[mediagoblin]
# database stuff
db_host = string()
-db_name = string()
+db_name = string(default="mediagoblin")
db_port = integer()
#
def setup_connection_and_db_from_config(app_config):
connection = connect_database_from_config(app_config)
- database_path = app_config.get('db_name', 'mediagoblin')
+ database_path = app_config['db_name']
db = connection[database_path]
models.register_models(connection)
# Could configure indexes here on db
celery_mongo_settings['port'] = app_config['db_port']
if celery_settings['BROKER_BACKEND'] == 'mongodb':
celery_settings['BROKER_PORT'] = app_config['db_port']
- celery_mongo_settings['database'] = app_config.get('db_name', 'mediagoblin')
+ celery_mongo_settings['database'] = app_config['db_name']
celery_settings['CELERY_MONGODB_BACKEND_SETTINGS'] = celery_mongo_settings