Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__pycache__/
env/
drfdocs.egg-info/
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include README.md
include LICENSE

recursive-include drfdocs/static *.js *.css *.png *.eot *.svg *.ttf *.woff
recursive-include drfdocs/templates *.html
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
# drf-docs
Documentation for Web APIs made with Django Rest Framework
# drf-docs [![Build Status](https://travis-ci.com/ekonstantinidis/drf-docs.svg?token=9QR4ewbqbkEmHps6q5sq&branch=master)](https://travis-ci.com/ekonstantinidis/drf-docs)
Documentation for Web APIs made with Django Rest Framework.


### Prerequisites

- Python (3.3, 3.4, 3.5)
- Django (1.8, 1.9)
- Django Rest Framework (3+)


### Development

pyvenv env
env/bin/pip install -r requirements.txt

# To test within another django project
pip install -e ~/Projects/drf-docs/

### Installation

Install using pip:

pip install drfdocs

Add 'drfdocs' to your `INSTALLED_APPS` setting:

INSTALLED_APPS = (
...
'drfdocs',
)

Finally include the `drfdocs` urls in your `urls.py`:

urlpatterns = [
...
url(r'^docs/', include('drfdocs.urls', namespace='drfdocs')),
]
11 changes: 11 additions & 0 deletions drfdocs/templates/drfdocs/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DRF Docs</title>
</head>
<body>
<h1>Django Rest Frameworks Docs</h1>

</body>
</html>
1 change: 1 addition & 0 deletions drfdocs/templates/drfdocs/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "drfdocs/base.html" %}
7 changes: 7 additions & 0 deletions drfdocs/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.conf.urls import url
from drfdocs.views import DRFDocsView

urlpatterns = [
# Url to view the API Docs
url(r'^$', DRFDocsView.as_view(), name='drfdocs'),
]
11 changes: 11 additions & 0 deletions drfdocs/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.views.generic.base import TemplateView


class DRFDocsView(TemplateView):

template_name = "drfdocs/home.html"

def get_context_data(self, **kwargs):
context = super(DRFDocsView, self).get_context_data(**kwargs)
context['example'] = True
return context
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import find_packages, setup

setup(
name="drf-docs",
name="drfdocs",
version=__import__('drfdocs').__version__,
author="Emmanouil Konstantinidis",
author_email="manos@iamemmanouil.com",
Expand All @@ -10,7 +10,7 @@
url="http://www.drfdocs.com",
license='BSD',
description="Documentation for Web APIs made with Django Rest Framework.",
long_description=open("README.txt").read(),
long_description=open("README.md").read(),
install_requires=[],
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down