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
f572862d
Commit
f572862d
authored
Jan 29, 2017
by
José Padilla
Committed by
GitHub
Jan 29, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4862 from felixxm/issue-cleanup-importlib
Removed unnecessary importlib wrapper.
parents
a8dbc220
1c437a79
Show 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 @
f572862d
...
@@ -17,11 +17,6 @@ from django.template import Context, RequestContext, Template
...
@@ -17,11 +17,6 @@ from django.template import Context, RequestContext, Template
from
django.utils
import
six
from
django.utils
import
six
from
django.views.generic
import
View
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
:
try
:
from
django.urls
import
(
from
django.urls
import
(
...
...
rest_framework/settings.py
View file @
f572862d
...
@@ -18,13 +18,13 @@ REST framework settings, checking for user settings first, then falling
...
@@ -18,13 +18,13 @@ REST framework settings, checking for user settings first, then falling
back to the defaults.
back to the defaults.
"""
"""
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
importlib
import
import_module
from
django.conf
import
settings
from
django.conf
import
settings
from
django.test.signals
import
setting_changed
from
django.test.signals
import
setting_changed
from
django.utils
import
six
from
django.utils
import
six
from
rest_framework
import
ISO_8601
from
rest_framework
import
ISO_8601
from
rest_framework.compat
import
importlib
DEFAULTS
=
{
DEFAULTS
=
{
# Base API policies
# Base API policies
...
@@ -174,7 +174,7 @@ def import_from_string(val, setting_name):
...
@@ -174,7 +174,7 @@ def import_from_string(val, setting_name):
# Nod to tastypie's use of importlib.
# Nod to tastypie's use of importlib.
parts
=
val
.
split
(
'.'
)
parts
=
val
.
split
(
'.'
)
module_path
,
class_name
=
'.'
.
join
(
parts
[:
-
1
]),
parts
[
-
1
]
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
)
return
getattr
(
module
,
class_name
)
except
(
ImportError
,
AttributeError
)
as
e
:
except
(
ImportError
,
AttributeError
)
as
e
:
msg
=
"Could not import '
%
s' for API setting '
%
s'.
%
s:
%
s."
%
(
val
,
setting_name
,
e
.
__class__
.
__name__
,
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