Skip to content

Commit 82421e5

Browse files
Merge pull request #83 from Brobin/support-viewsets
Support viewsets
2 parents 35d2f0a + f44ccba commit 82421e5

File tree

6 files changed

+16
-23
lines changed

6 files changed

+16
-23
lines changed

Diff for: docs/changelog.md

+7-1
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

Diff for: docs/installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ Finally include the `rest_framework_docs` urls in your `urls.py`:
2222
url(r'^docs/', include('rest_framework_docs.urls')),
2323
]
2424

25-
You can now visit [http://0.0.0.0:/8000/docs/](http://0.0.0.0:/8000/docs/) to view your Web API's docs.
25+
You can now visit [http://0.0.0.0:/8000/docs/](http://0.0.0.0:8000/docs/) to view your Web API's docs.

Diff for: docs/settings.md

+3-3
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

Diff for: docs/templates.md

+3-16
Original file line numberDiff line numberDiff line change
@@ -5,69 +5,58 @@ source_filename: templates
55
### Create the template file
66
To edit the template you will have to create a `.html` file to override the original one. Inside your `templates` directory create a directory named `rest_framework_docs` and inside this create the file `docs.html`. You can then extend/override the default template.
77

8-
{% raw %}
98
{% extends "rest_framework_docs/base.html" %}
10-
{% endraw %}
119

1210

1311
### Default Blocks
1412

1513
##### Styles (CSS)
1614

17-
{% raw %}
1815
{% block style %}
1916
<link rel="stylesheet" href="{% static "path/to/custom/css/style.css" %}">
2017
{% endblock %}
21-
{% endraw %}
2218

2319
##### GitHub Badge
2420
To hide the GitHub badge from the page, just override it with an empty block.
2521

26-
{% raw %}{% block github_badge %}{% endblock %}{% endraw %}
22+
{% block github_badge %}{% endblock %}
2723

2824
##### Title
2925

30-
{% raw %}{% block title %}Project Name{% endblock %}{% endraw %}
26+
{% block title %}Project Name{% endblock %}
3127

3228
##### Logo
3329

34-
{% raw %}
3530
{% block logo %}
3631
<a class="navbar-brand" href="http://www.drfdocs.com/">DRF Docs</a>
3732
{% endblock %}
38-
{% endraw %}
3933

4034
##### Jumbotron
4135

42-
{% raw %}
4336
{% block jumbotron %}
4437
<div class="jumbotron">
4538
<h1>Project Title</h1>
4639
<h3>Documentantion of the project 'Example'.</h3>
4740
</div>
4841
{% endblock %}
49-
{% endraw %}
5042

5143
##### Footer
5244

53-
{% raw %}
5445
{% block footer %}
5546
<div class="footer">
5647
<div class="links">
5748
<a href="http://www.iamemmanouil.com"><i class="fa fa-link"></i></a>
5849
<a href="http://www.github.com/ekonstantinidis"><i class="fa fa-github"></i></a>
5950
<a href="http://www.twitter.com/iamemmanouil"><i class="fa fa-twitter"></i></a>
6051
</div>
61-
Copyright © 2015 Emmanouil Konstantinidis.
52+
Copyright © 2016 Emmanouil Konstantinidis.
6253
</div>
6354
{% endblock %}
64-
{% endraw %}
6555

6656

6757
### Complete Example
6858
File location: `templates/rest_framework_docs/docs.html`
6959

70-
{% raw %}
7160
{% extends "rest_framework_docs/base.html" %}
7261

7362
{% block title %}Project Name{% endblock %}
@@ -81,5 +70,3 @@ File location: `templates/rest_framework_docs/docs.html`
8170
{% endblock %}
8271

8372
{% block footer %}<div class="footer">Copyright © 2016 Project Name.</div>{% endblock %}
84-
85-
{% endraw %}

Diff for: rest_framework_docs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.0.7'
1+
__version__ = '0.0.9'

Diff for: tests/tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_index_view_with_endpoints(self):
3131

3232
# Test the login view
3333
self.assertEqual(response.context["endpoints"][0].name_parent, "accounts")
34-
self.assertEqual(response.context["endpoints"][0].allowed_methods, ['POST', 'OPTIONS'])
34+
self.assertEqual(sorted(response.context["endpoints"][0].allowed_methods), sorted(['OPTIONS', 'POST']))
3535
self.assertEqual(response.context["endpoints"][0].path, "/accounts/login/")
3636
self.assertEqual(response.context["endpoints"][0].docstring, "A view that allows users to login providing their username and password.")
3737
self.assertEqual(len(response.context["endpoints"][0].fields), 2)

0 commit comments

Comments
 (0)