summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-01-20 22:15:14 +0200
committerTim Graham <timograham@gmail.com>2014-02-08 11:12:19 -0500
commit5d263dee304fdaf95e18d2f0619d6925984a7f02 (patch)
tree764bc0cd21bca796d9f1bd0b8d2645a9773e48de /docs/ref
parentfcc21837dc691ba6465853c0b68927cb075a4591 (diff)
Fixed #21674 -- Deprecated the import_by_path() function in favor of import_string().
Thanks Aymeric Augustin for the suggestion and review.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/utils.txt23
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``
===========================