diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/utils.txt | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 6cac9fa058..5313a1de19 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -709,22 +709,31 @@ escaping HTML. Functions for working with Python modules. -.. function:: import_by_path(dotted_path, error_prefix='') +.. function:: import_string(dotted_path) - .. versionadded:: 1.6 + .. versionadded:: 1.7 Imports a dotted module path and returns the attribute/class designated by - the last name in the path. Raises - :exc:`~django.core.exceptions.ImproperlyConfigured` if something goes - wrong. For example:: + the last name in the path. Raises ``ImportError`` if the import failed. For + example:: - from django.utils.module_loading import import_by_path - ImproperlyConfigured = import_by_path('django.core.exceptions.ImproperlyConfigured') + from django.utils.module_loading import import_string + ImproperlyConfigured = import_string('django.core.exceptions.ImproperlyConfigured') is equivalent to:: from django.core.exceptions import ImproperlyConfigured +.. function:: import_by_path(dotted_path, error_prefix='') + + .. versionadded:: 1.6 + .. deprecated:: 1.7 + Use :meth:`~django.utils.module_loading.import_string` instead. + + Imports a dotted module path and returns the attribute/class designated by + the last name in the path. Raises :exc:`~django.core.exceptions.ImproperlyConfigured` + if something goes wrong. + ``django.utils.safestring`` =========================== |
