Skip to content

Commit 235bd76

Browse files
Merge pull request #8 from ekonstantinidis/rebrand
Rebrand Project
2 parents 9ce68c5 + 9a9bac0 commit 235bd76

File tree

15 files changed

+85
-40
lines changed

15 files changed

+85
-40
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
__pycache__/
33

44
env/
5-
drfdocs.egg-info/
5+
djangorestframeworkdocs.egg-info/

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
language: python
22

33
python:
4+
- "2.7"
45
- "3.3"
56
- "3.4"
67
- "3.5"
8+
- "pypy"
79
- "pypy3"
810

911
install:
@@ -14,4 +16,4 @@ script:
1416

1517
notifications:
1618
slack:
17-
secure: ITmN/3Db23HEcHP5pwoBjGE3qC5w/vOhCOGoefBTGV133YPqcAft1TDA+qQRcB87Da2qcechiR8DwWYVSbugd52lnOnEgwyb+fpTLKKyzU6u5QP6sMjBo+umLwwQSLp9UlctdbgidEOZlYML7H7LTwXrek5g/HXWawHZ90jr60rLKa0qVqFlljx+663VAiw07ro1gx66q60Ptc40OYstgskCVEG2Nb6vCMhE2bqvLRlTBoFvkdLGJdJW9S+WofJMNlRJBHK/boLpWx2/fS6IJFJxo3HvFHcu79OBoe7Oi3WYPjikZB2iNOAv1rHGq7GlFqAiHgnG4USDLyl8vyagsAqwllIcNtNoPh3Yu3TsfGDYs3opRKSLxMp1pvWNLAI1D7y55zPVCdADUziLjBSYSSd0Mcws/plmex7g+N8y650aQu5lVRysiN0Ug9YnQsOKNIAGL4s7/BIlDRtN5ZkUdPmRjrqrBK74eiKBZi+JVkoQTIBiQ2qr2/UugYfwUuB1NSIiIGujHu9j4KPooeVzgJdRIGYTPCQH9TYQ3Al/iY+cbVBecTf6mbEsXDsNrRfGJcI1K3G3YLP3buzGzQoTpR/buTnwgRMiXMuTIx4/I5jmYFSnvSK86O/kpGbPCMXIG9MMmldBy95y1D10CAKr8WRwiw0dYzJ+cdJz2GKWhEk=
19+
secure: ZTzxh+tXuf7uaFMBQtrjupS+qqtM3dsnYgHptErsg3SjH0q1jH+HpKD+1RlqGqN36mREB1wSlOhGMzfyGNeNhl0PHQLEtZhs3dRLdzR1xMZWKm7xtCe4TcFoSPh5SoLOHrQVaSEyHeE53gkbOfI7Q5SqVRJOlJv9iCCD8TM+KVdDubCeByevunFSzGFwdLvtk7QpRwXivOGJdJHXXWgVl6ieviQKun5Z03woiLr5L4p37szVkbD60T5lFYAhCL1PzLQ6hVhDn7L4J06LIaQ+l+Jp6cunB1iJtR1Rz+C7g/r2VGgJ5G3sHB3QyFqw9Q/E3oBB81xQTwjL7WSfDuKctW2CPWHac0T9VhidQDoq7uR0EYPMkZXnc+iZa5wmL8IfjEadse0rxdfiIOE+mev+i5BrzHBq/+tZV/D+HKzsRXUEf3BZaRpq7gQHWbj0dusX+R504BQtKqYaGqBFdWJ0+Dry739R4xTeWk10Xa3wpzSFQ1c0yUQbY+3W/DNSYKcRV+Z9eGhMSO1QfBlGzqTlkWkVDnD9OYIpo5iJOkDouJVtzPOyyFBoNGqkvUHiKBO6ohuh48S3xXrjhihkz8xuOSrU1W7xGhCG2RA/vHZh8Fm20l1oIJ/p/Gn6kTLT33XZsxnF9C0Qmgvr6f96MKNPJjNKp0zYj4tJaZr9Xi4rsD8=

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# drf-docs [![travis][travis-image]][travis-url] [![pypi][pypi-image]][pypi-url]
1+
# [Django Rest Framework Docs](http://www.drfdocs.com/) [![travis][travis-image]][travis-url] [![pypi][pypi-image]][pypi-url]
22

33
Document Web APIs made with Django Rest Framework.
44

@@ -22,24 +22,42 @@ Document Web APIs made with Django Rest Framework.
2222

2323
Install using pip:
2424

25-
pip install drfdocs
25+
pip install djangorestframeworkdocs
2626

27-
Add 'drfdocs' to your `INSTALLED_APPS` setting:
27+
Add 'rest_framework_docs' to your `INSTALLED_APPS` setting:
2828

2929
INSTALLED_APPS = (
3030
...
31-
'drfdocs',
31+
'rest_framework_docs',
3232
)
3333

34-
Finally include the `drfdocs` urls in your `urls.py`:
34+
Finally include the `rest_framework_docs` urls in your `urls.py`:
3535

3636
urlpatterns = [
3737
...
38-
url(r'^docs/', include('drfdocs.urls', app_name='drfdocs', namespace='drfdocs')),
38+
url(r'^docs/', include('rest_framework_docs.urls')),
3939
]
4040

41-
[travis-image]: https://travis-ci.com/ekonstantinidis/drf-docs.svg?token=9QR4ewbqbkEmHps6q5sq&branch=master
42-
[travis-url]: https://travis-ci.com/ekonstantinidis/drf-docs
41+
### Settings
4342

44-
[pypi-image]: https://img.shields.io/pypi/v/drfdocs.svg
45-
[pypi-url]: https://pypi.python.org/pypi/drffocs/
43+
REST_FRAMEWORK_DOCS = {
44+
'HIDDEN': True # Default: False
45+
}
46+
47+
### Roadmap
48+
49+
- [ ] Support Python 2 & Python 3
50+
- [ ] Support DRF 3+
51+
- [ ] Open Pull Request to include in DRF
52+
- [ ] Submit to djangopackages.com
53+
54+
55+
### Credits
56+
57+
First of all thanks to the [Django](http://www.djangoproject.com/) core team and to all the contributors of [Django REST Framework](http://www.django-rest-framework.org/) for their amazing work. Also I would like to thank [Marc Gibbons](https://github.com/marcgibbons) for his *django-rest-framework-docs* project. Both projects share the same idea, it is just that Marc's is not maintained anymore and does not support DRF 3+ & Python 3.
58+
59+
[travis-image]: https://travis-ci.com/ekonstantinidis/django-rest-framework-docs.svg?token=9QR4ewbqbkEmHps6q5sq&branch=master
60+
[travis-url]: https://travis-ci.com/ekonstantinidis/django-rest-framework-docs
61+
62+
[pypi-image]: https://img.shields.io/pypi/v/djangorestframeworkdocs.svg
63+
[pypi-url]: https://pypi.python.org/pypi/djangorestframeworkdocs/

drfdocs/views.py

Lines changed: 0 additions & 13 deletions
This file was deleted.
File renamed without changes.

drfdocs/api_docs.py renamed to rest_framework_docs/api_docs.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
from django.conf import settings
22
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
3-
from drfdocs.api_endpoint import ApiEndpoint
43
from rest_framework.views import APIView
4+
from rest_framework_docs.api_endpoint import ApiEndpoint
55

66

77
class ApiDocumentation(object):
8-
excluded_apps = ["admin", "drfdocs"]
9-
excluded_endpoints = ["serve"]
108

119
def __init__(self):
1210
self.endpoints = []
@@ -15,9 +13,9 @@ def __init__(self):
1513

1614
def get_all_view_names(self, urlpatterns, parent_pattern=None):
1715
for pattern in urlpatterns:
18-
if isinstance(pattern, RegexURLResolver) and (pattern.app_name not in self.excluded_apps):
16+
if isinstance(pattern, RegexURLResolver):
1917
self.get_all_view_names(urlpatterns=pattern.url_patterns, parent_pattern=pattern)
20-
elif isinstance(pattern, RegexURLPattern) and (pattern.callback.__name__ not in self.excluded_endpoints) and self._is_drf_view(pattern):
18+
elif isinstance(pattern, RegexURLPattern) and self._is_drf_view(pattern):
2119
api_endpoint = ApiEndpoint(pattern, parent_pattern)
2220
self.endpoints.append(api_endpoint)
2321

File renamed without changes.

rest_framework_docs/settings.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from django.conf import settings
2+
3+
4+
class DRFSettings(object):
5+
6+
def __init__(self):
7+
self.drf_settings = {
8+
"HIDDEN": self.get_setting("HIDDEN") or False
9+
}
10+
11+
def get_setting(self, name):
12+
try:
13+
return settings.REST_FRAMEWORK_DOCS[name]
14+
except:
15+
return None
16+
17+
@property
18+
def settings(self):
19+
return self.drf_settings

drfdocs/templates/drfdocs/base.html renamed to rest_framework_docs/templates/rest_framework_docs/base.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta http-equiv="X-UA-Compatible" content="IE=edge">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99

10-
<title>DRF Docs</title>
10+
<title>{% block title %}DRF Docs{% endblock %}</title>
1111

1212
<!-- Bootstrap & Flatly -->
1313
<link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/flatly/bootstrap.min.css" rel="stylesheet">
@@ -41,7 +41,7 @@
4141
<span class="icon-bar"></span>
4242
<span class="icon-bar"></span>
4343
</button>
44-
<a class="navbar-brand" href="#">DRF Docs</a>
44+
{% block logo %}<a class="navbar-brand" href="http://www.drfdocs.com/">DRF Docs</a>{% endblock %}
4545
</div>
4646

4747
<!-- Collect the nav links, forms, and other content for toggling -->
@@ -65,6 +65,7 @@ <h3>Document Web APIs made with <a href="http://www.django-rest-framework.org/"
6565

6666
{% block content %}{% endblock %}
6767

68+
{% block footer %}
6869
<div class="footer">
6970
<div class="links">
7071
<a href="http://www.iamemmanouil.com"><i class="fa fa-link"></i></a>
@@ -73,6 +74,7 @@ <h3>Document Web APIs made with <a href="http://www.django-rest-framework.org/"
7374
</div>
7475
Copyright © 2015 Emmanouil Konstantinidis.
7576
</div>
77+
{% endblock %}
7678
</div>
7779

7880
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->

0 commit comments

Comments
 (0)