django.apps.AppConfig.create - python examples

Here are the examples of the python api django.apps.AppConfig.create taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 View Complete Implementation : settings.py
Copyright MIT License
Author : learningequality
def _apply_base_settings(plugin_instance, settings_module):
    # Instead of just adding the module path to the settings
    # we instantiate an app config object for the plugin
    # and explicitly set its label to its module path.
    # This way, there is no way for a plugin to collide in its
    # label in the Django App Registry with kolibri core apps
    # or Kolibri core plugins.
    app_config = AppConfig.create(plugin_instance.module_path)
    app_config.label = plugin_instance.module_path
    # Register the plugin as an installed app
    _set_setting_value("INSTALLED_APPS", (app_config,), settings_module)
    plugin_instance.INSTALLED_APPS.append(app_config)
    # Add in the external plugins' locale paths. Our frontend messages depends
    # specifically on the value of LOCALE_PATHS to find its catalog files.
    if is_external_plugin(
        plugin_instance.module_path
    ) and i18n.get_installed_app_locale_path(plugin_instance.module_path):
        _set_setting_value(
            "LOCALE_PATHS",
            (i18n.get_installed_app_locale_path(plugin_instance.module_path),),
            settings_module,
        )