Skip to main content

API docs for django

Project description

# django-api-doc

API docs for django

## Installation

Install using `pip`

```
pip install django_api_doc
```

or

```
git clone git@github.com:fanhan/django-api-doc.git

cd django-api-doc/

python setup.py install

```

## Example

Add `django_api_doc` to your INSTALLED_APPS setting.

```
INSTALLED_APPS = (
...
'django_api_doc',
)
```

Now edit the your_project/urls.py module in your project:

```
urlpatterns = [
...
url(r'^api-docs/', include('django_api_doc.urls', namespace='api_docs')),
]
```

In your project `urls.py`, you need set `name` or `namespace`

```
urlpatterns = [
...
url(r'^common/', include('apps.test.urls', namespace='test')),
]
```

In `your_apps/urls.py`, you can set urlpatterns like this...

```
urlpatterns = [
...
url(r'^$', views.TestIndex.as_view(), name='test_index'),
]
```


In `view.py`, please use the `markdown` to write comments

```python

class TestIndexView(View):
"""
test
"""

def get(self, request):
"""
test index

#### Param

params | category | must | description
---- | ---- | ---- | ----
null | null | null | null

#### Return
{
"text": "test",
}

"""
pass
```

then, open the url `http://127.0.0.1:8000/api-docs/`, you can see


## Add some parameters

```
API_DOC_IGNORE_NAMESPACES = [] # ignore your_project/urls.py namespaces
API_DOC_TITLE = '' # doc html title
API_DOC_API_DOMAIN = 'http://api.com' # api domain
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_api_doc-0.2.tar.gz (62.1 kB view details)

Uploaded Source

File details

Details for the file django_api_doc-0.2.tar.gz.

File metadata

File hashes

Hashes for django_api_doc-0.2.tar.gz
Algorithm Hash digest
SHA256 394337b0611beebdfcab47139619691d4f3b3e679af8b64b381643c88b2a7253
MD5 25d5c6d2f1b56c7b2979e196bc433957
BLAKE2b-256 5bc95f59333cf92ce1dd4d1ea4735449e2bad3131ec3567e6c32859ed93b09ed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page