django_evolution.utils.apps

Utilities for working with apps.

Functions

get_app_config_for_app(app)

Return the app configuration for an app.

get_app_label(app)

Return the label of an app.

get_app_name(app)

Return the name of an app.

get_legacy_app_label(app)

Return the label of an app.

import_management_modules()

Import the management modules for all apps.

django_evolution.utils.apps.get_app_config_for_app(app)

Return the app configuration for an app.

This can only be called if running on Django 1.7 or higher.

Parameters:

app (module) – The app’s models module to return the configuration for. The models module is used for legacy reasons within Django Evolution.

Returns:

The app configuration, or None if it couldn’t be found.

Return type:

django.apps.AppConfig

django_evolution.utils.apps.get_app_label(app)

Return the label of an app.

Parameters:

app (module) – The app.

Returns:

The label of the app.

Return type:

str

django_evolution.utils.apps.get_app_name(app)

Return the name of an app.

Parameters:

app (module) – The app.

Returns:

The name of the app.

Return type:

str

django_evolution.utils.apps.get_legacy_app_label(app)

Return the label of an app.

Parameters:

app (module) – The app.

Returns:

The label of the app.

Return type:

str

django_evolution.utils.apps.import_management_modules()

Import the management modules for all apps.

Management modules often contain signal handlers for pre/post syncdb/migrate events. This will import them correctly for the current version of Django.

Raises:

ImportError – A management module failed to import.