Skip to content

Commit 5da2ab4

Browse files
committedDec 21, 2015
Merge pull request #33 from ekonstantinidis/fix-reading-urls
Catch both cases of common ROOT_URLCONF
2 parents 13d0b07 + dd5a310 commit 5da2ab4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

‎rest_framework_docs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.0.4'
1+
__version__ = '0.0.5'

‎rest_framework_docs/api_docs.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ class ApiDocumentation(object):
99
def __init__(self):
1010
self.endpoints = []
1111
root_urlconf = __import__(settings.ROOT_URLCONF)
12-
self.get_all_view_names(root_urlconf.urls.urlpatterns)
12+
if hasattr(root_urlconf, 'urls'):
13+
self.get_all_view_names(root_urlconf.urls.urlpatterns)
14+
else:
15+
self.get_all_view_names(root_urlconf.urlpatterns)
1316

1417
def get_all_view_names(self, urlpatterns, parent_pattern=None):
1518
for pattern in urlpatterns:

0 commit comments

Comments
 (0)
Please sign in to comment.