Skip to content

Commit 0fd3c1d

Browse files
author
Marc
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # rest_framework_docs/__init__.py # rest_framework_docs/api_docs.py
2 parents c6bbf50 + 8177829 commit 0fd3c1d

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

docs/changelog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ title: "Changelog"
33
source_filename: "changelog"
44
---
55

6+
### Release 0.0.9
7+
8+
- Support for more types of `ROOT_URLCONF`
9+
- Move docs to [MKDocs](http://www.mkdocs.org/)
10+
11+
612
### Release 0.0.7
713

814
- Fix methods in Live API Endpoints (now compatible with Python 2.7)
@@ -18,7 +24,7 @@ source_filename: "changelog"
1824

1925
### Release 0.0.5
2026

21-
- Support both common types of ROOT_URLCONF
27+
- Support both common types of `ROOT_URLCONF`
2228

2329

2430
### Release 0.0.4

docs/settings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ To set DRF docs' settings just include the dictionary below in Django's `setting
1212

1313
### Settings Description
1414

15-
##### HIDDEN
15+
##### HIDE_DOCS
1616
You can use hidden to prevent your docs from showing up in different environments (ie. Show in development, hide in production). To do so you can use environment variables.
1717

1818
REST_FRAMEWORK_DOCS = {
19-
'HIDE_DOCS': os.environ.get('SHOW_DRFDOCS', False)
19+
'HIDE_DOCS': os.environ.get('HIDE_DRFDOCS', False)
2020
}
2121

22-
Then set the value of the environment variable `SHOW_DRFDOCS` for each environment (ie. Use `.env` files)
22+
Then set the value of the environment variable `HIDE_DRFDOCS` for each environment (ie. Use `.env` files)
2323

2424
### List of Settings
2525

rest_framework_docs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '0.0.7'
1+
__version__ = '0.0.9'
22

33
SERIALIZER_FIELDS = {}

rest_framework_docs/api_docs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from operator import attrgetter
2+
from importlib import import_module
23

34
from django.conf import settings
45
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
@@ -17,7 +18,11 @@ def __init__(self, filter_param=None):
1718
"""
1819
SERIALIZER_FIELDS.clear()
1920
self.endpoints = []
20-
root_urlconf = import_string(settings.ROOT_URLCONF)
21+
try:
22+
root_urlconf = import_string(settings.ROOT_URLCONF)
23+
except ImportError:
24+
# Handle a case when there's no dot in ROOT_URLCONF
25+
root_urlconf = import_module(settings.ROOT_URLCONF)
2126
if hasattr(root_urlconf, 'urls'):
2227
self.get_all_view_names(root_urlconf.urls.urlpatterns, filter_param=filter_param)
2328
else:

0 commit comments

Comments
 (0)