Skip to content

Commit 8ef3242

Browse files
author
Emmanouil Konstantinidis
committed
Set up DRF docs in demo project
1 parent 40c84b7 commit 8ef3242

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

demo/project/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
'django.contrib.sessions',
3838
'django.contrib.messages',
3939
'django.contrib.staticfiles',
40+
41+
'rest_framework',
42+
'rest_framework_docs',
4043
)
4144

4245
MIDDLEWARE_CLASSES = (

demo/project/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818

1919
urlpatterns = [
2020
url(r'^admin/', include(admin.site.urls)),
21+
url(r'^docs/', include('rest_framework_docs.urls')),
2122
]

rest_framework_docs/templates/rest_framework_docs/home.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
{% regroup endpoints by name_parent as endpoints_grouped %}
1919

20+
{% if endpoints_grouped %}
2021
{% for group in endpoints_grouped %}
22+
2123
<h1 id="{{ group.grouper|lower }}">{{group.grouper}}</h1>
2224

2325
<div class="panel-group" role="tablist">
@@ -64,5 +66,8 @@ <h4 class="panel-title title">
6466
</div>
6567

6668
{% endfor %}
69+
{% else %}
70+
<h2 class="center">There are currently no api endpoints to document.</h2>
71+
{% endif %}
6772

6873
{% endblock %}

0 commit comments

Comments
 (0)