We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0712094 commit 6b0bf72Copy full SHA for 6b0bf72
rest_framework/settings.py
@@ -179,8 +179,7 @@ def import_from_string(val, setting_name):
179
"""
180
try:
181
# Nod to tastypie's use of importlib.
182
- parts = val.split('.')
183
- module_path, class_name = '.'.join(parts[:-1]), parts[-1]
+ module_path, class_name = val.rsplit('.', 1)
184
module = import_module(module_path)
185
return getattr(module, class_name)
186
except (ImportError, AttributeError) as e:
0 commit comments