Fixed #22618 -- Improved import_string example.
Thanks ewjoachim for the sugggestion.
This commit is contained in:
parent
a1be7237ca
commit
c501662f3c
|
@ -719,11 +719,11 @@ Functions for working with Python modules.
|
||||||
example::
|
example::
|
||||||
|
|
||||||
from django.utils.module_loading import import_string
|
from django.utils.module_loading import import_string
|
||||||
ImproperlyConfigured = import_string('django.core.exceptions.ImproperlyConfigured')
|
ValidationError = import_string('django.core.exceptions.ValidationError')
|
||||||
|
|
||||||
is equivalent to::
|
is equivalent to::
|
||||||
|
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ValidationError
|
||||||
|
|
||||||
.. function:: import_by_path(dotted_path, error_prefix='')
|
.. function:: import_by_path(dotted_path, error_prefix='')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue