def configure():
    from celery import current_app
    from celery.loaders.default import DEFAULT_CONFIG_MODULE
    from django.conf import settings

    app = current_app
    conf = {}

    if not settings.configured:
        if 'loader' in app.__dict__ and app.loader.configured:
            conf = current_app.loader.conf
        else:
            os.environ.pop('CELERY_LOADER', None)
            settings_module = os.environ.get('CELERY_CONFIG_MODULE',
                                             DEFAULT_CONFIG_MODULE)
            try:
                import_from_cwd(settings_module)
            except __HOLE__:
                settings_module = default_settings()
        settings.configure(SETTINGS_MODULE=settings_module,
                           **dict(DEFAULTS, **conf))
dataset/ETHPy150Open celery/django-celery/djcelery/mon.py/configure