Skip to content

Commit a1ad2d7

Browse files
Merge pull request #62 from andrewyoung1991/patch-1
Use Django's module loading rather than __import__
2 parents 112674b + 694a3e1 commit a1ad2d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_framework_docs/api_docs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.conf import settings
22
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
3+
from django.utils.module_loading import import_string
34
from rest_framework.views import APIView
45
from rest_framework_docs.api_endpoint import ApiEndpoint
56

@@ -8,7 +9,7 @@ class ApiDocumentation(object):
89

910
def __init__(self):
1011
self.endpoints = []
11-
root_urlconf = __import__(settings.ROOT_URLCONF)
12+
root_urlconf = import_string(settings.ROOT_URLCONF)
1213
if hasattr(root_urlconf, 'urls'):
1314
self.get_all_view_names(root_urlconf.urls.urlpatterns)
1415
else:

0 commit comments

Comments
 (0)