Skip to content

Commit 95b0bd7

Browse files
Merge pull request #2 from ekonstantinidis/more-setup
More Setup
2 parents 3223a16 + 4802d92 commit 95b0bd7

File tree

8 files changed

+67
-4
lines changed

8 files changed

+67
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
__pycache__/
12
env/
3+
drfdocs.egg-info/

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include README.md
2+
include LICENSE
3+
4+
recursive-include drfdocs/static *.js *.css *.png *.eot *.svg *.ttf *.woff
5+
recursive-include drfdocs/templates *.html
6+
recursive-exclude * __pycache__
7+
recursive-exclude * *.py[co]

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
1-
# drf-docs
2-
Documentation for Web APIs made with Django Rest Framework
1+
# drf-docs [![Build Status](https://travis-ci.com/ekonstantinidis/drf-docs.svg?token=9QR4ewbqbkEmHps6q5sq&branch=master)](https://travis-ci.com/ekonstantinidis/drf-docs)
2+
Documentation for Web APIs made with Django Rest Framework.
33

44

55
### Prerequisites
66

77
- Python (3.3, 3.4, 3.5)
88
- Django (1.8, 1.9)
9+
- Django Rest Framework (3+)
910

1011

1112
### Development
1213

1314
pyvenv env
1415
env/bin/pip install -r requirements.txt
16+
17+
# To test within another django project
18+
pip install -e ~/Projects/drf-docs/
19+
20+
### Installation
21+
22+
Install using pip:
23+
24+
pip install drfdocs
25+
26+
Add 'drfdocs' to your `INSTALLED_APPS` setting:
27+
28+
INSTALLED_APPS = (
29+
...
30+
'drfdocs',
31+
)
32+
33+
Finally include the `drfdocs` urls in your `urls.py`:
34+
35+
urlpatterns = [
36+
...
37+
url(r'^docs/', include('drfdocs.urls', namespace='drfdocs')),
38+
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>DRF Docs</title>
6+
</head>
7+
<body>
8+
<h1>Django Rest Frameworks Docs</h1>
9+
10+
</body>
11+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "drfdocs/base.html" %}

drfdocs/urls.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.conf.urls import url
2+
from drfdocs.views import DRFDocsView
3+
4+
urlpatterns = [
5+
# Url to view the API Docs
6+
url(r'^$', DRFDocsView.as_view(), name='drfdocs'),
7+
]

drfdocs/views.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.views.generic.base import TemplateView
2+
3+
4+
class DRFDocsView(TemplateView):
5+
6+
template_name = "drfdocs/home.html"
7+
8+
def get_context_data(self, **kwargs):
9+
context = super(DRFDocsView, self).get_context_data(**kwargs)
10+
context['example'] = True
11+
return context

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import find_packages, setup
22

33
setup(
4-
name="drf-docs",
4+
name="drfdocs",
55
version=__import__('drfdocs').__version__,
66
author="Emmanouil Konstantinidis",
77
author_email="manos@iamemmanouil.com",
@@ -10,7 +10,7 @@
1010
url="http://www.drfdocs.com",
1111
license='BSD',
1212
description="Documentation for Web APIs made with Django Rest Framework.",
13-
long_description=open("README.txt").read(),
13+
long_description=open("README.md").read(),
1414
install_requires=[],
1515
classifiers=[
1616
'Development Status :: 5 - Production/Stable',

0 commit comments

Comments
 (0)