Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
1c437a79
Unverified
Commit
1c437a79
authored
Jan 29, 2017
by
Mariusz Felisiak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unnecessary importlib wrapper.
parent
220be317
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
7 deletions
+2
-7
rest_framework/compat.py
+0
-5
rest_framework/settings.py
+2
-2
No files found.
rest_framework/compat.py
View file @
1c437a79
...
...
@@ -17,11 +17,6 @@ from django.template import Context, RequestContext, Template
from
django.utils
import
six
from
django.views.generic
import
View
try
:
import
importlib
# Available in Python 3.1+
except
ImportError
:
from
django.utils
import
importlib
# Will be removed in Django 1.9
try
:
from
django.urls
import
(
...
...
rest_framework/settings.py
View file @
1c437a79
...
...
@@ -18,13 +18,13 @@ REST framework settings, checking for user settings first, then falling
back to the defaults.
"""
from
__future__
import
unicode_literals
from
importlib
import
import_module
from
django.conf
import
settings
from
django.test.signals
import
setting_changed
from
django.utils
import
six
from
rest_framework
import
ISO_8601
from
rest_framework.compat
import
importlib
DEFAULTS
=
{
# Base API policies
...
...
@@ -174,7 +174,7 @@ def import_from_string(val, setting_name):
# Nod to tastypie's use of importlib.
parts
=
val
.
split
(
'.'
)
module_path
,
class_name
=
'.'
.
join
(
parts
[:
-
1
]),
parts
[
-
1
]
module
=
import
lib
.
import
_module
(
module_path
)
module
=
import_module
(
module_path
)
return
getattr
(
module
,
class_name
)
except
(
ImportError
,
AttributeError
)
as
e
:
msg
=
"Could not import '
%
s' for API setting '
%
s'.
%
s:
%
s."
%
(
val
,
setting_name
,
e
.
__class__
.
__name__
,
e
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment