MCPcopy Create free account
hub / github.com/celery/celery / read_configuration

Method read_configuration

celery/loaders/default.py:25–44  ·  view source on GitHub ↗

Read configuration from :file:`celeryconfig.py`.

(self, fail_silently=True)

Source from the content-addressed store, hash-verified

23 return DictAttribute(settingsdict)
24
25 def read_configuration(self, fail_silently=True):
26 """Read configuration from :file:`celeryconfig.py`."""
27 configname = os.environ.get('CELERY_CONFIG_MODULE',
28 DEFAULT_CONFIG_MODULE)
29 try:
30 usercfg = self._import_config_module(configname)
31 except ImportError:
32 if not fail_silently:
33 raise
34 # billiard sets this if forked using execv
35 if C_WNOCONF and not os.environ.get('FORKED_BY_MULTIPROCESSING'):
36 warnings.warn(NotConfigured(
37 'No {module} module found! Please make sure it exists and '
38 'is available to Python.'.format(module=configname)),
39 stacklevel=2,
40 )
41 return self.setup_settings({})
42 else:
43 self.configured = True
44 return self.setup_settings(usercfg)

Calls 6

setup_settingsMethod · 0.95
NotConfiguredClass · 0.90
_import_config_moduleMethod · 0.80
warnMethod · 0.80
getMethod · 0.45
formatMethod · 0.45