{"id":16710854,"url":"https://github.com/chris48s/django-apiblueprint-view","last_synced_at":"2025-03-15T13:30:54.359Z","repository":{"id":23381588,"uuid":"98824071","full_name":"chris48s/django-apiblueprint-view","owner":"chris48s","description":"📚 Render API Blueprints on-the-fly using Django templates","archived":false,"fork":false,"pushed_at":"2024-11-25T21:49:54.000Z","size":570,"stargazers_count":16,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T01:52:49.607Z","etag":null,"topics":["api-blueprint","django-apps","documentation"],"latest_commit_sha":null,"homepage":"https://pypi.org/pypi/django-apiblueprint-view/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chris48s.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-30T20:51:14.000Z","updated_at":"2024-11-07T19:29:52.000Z","dependencies_parsed_at":"2023-09-28T12:03:59.629Z","dependency_job_id":"5ccaf0b0-8d00-4fb1-9795-76307606e27a","html_url":"https://github.com/chris48s/django-apiblueprint-view","commit_stats":{"total_commits":235,"total_committers":5,"mean_commits":47.0,"dds":0.5276595744680851,"last_synced_commit":"45b8a80316a6718937308fbc4af9b91516114314"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris48s%2Fdjango-apiblueprint-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris48s%2Fdjango-apiblueprint-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris48s%2Fdjango-apiblueprint-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris48s%2Fdjango-apiblueprint-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris48s","download_url":"https://codeload.github.com/chris48s/django-apiblueprint-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243735797,"owners_count":20339530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-blueprint","django-apps","documentation"],"created_at":"2024-10-12T20:09:47.419Z","updated_at":"2025-03-15T13:30:54.082Z","avatar_url":"https://github.com/chris48s.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-apiblueprint-view\n\n[![Run tests](https://github.com/chris48s/django-apiblueprint-view/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/chris48s/django-apiblueprint-view/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/chris48s/django-apiblueprint-view/branch/master/graph/badge.svg?token=31PZQZ1E5U)](https://codecov.io/gh/chris48s/django-apiblueprint-view)\n![PyPI Version](https://img.shields.io/pypi/v/django-apiblueprint-view.svg)\n![License](https://img.shields.io/pypi/l/django-apiblueprint-view.svg)\n![Python Compatibility](https://img.shields.io/badge/dynamic/json?query=info.requires_python\u0026label=python\u0026url=https%3A%2F%2Fpypi.org%2Fpypi%2Fdjango-apiblueprint-view%2Fjson)\n![Django Support](https://img.shields.io/pypi/djversions/django-apiblueprint-view.svg)\n![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)\n\nRender [API Blueprints](https://apiblueprint.org/) on-the-fly using Django templates\n\n## Installation\n\n1. `pip install django-apiblueprint-view`\n\n2. Add to `INSTALLED_APPS` in django settings:\n\n```python\nINSTALLED_APPS = [\n    ...\n    'apiblueprint_view',\n]\n```\n\n## Usage\n\n```python\nfrom apiblueprint_view.views import ApiBlueprintView\n\nurlpatterns = [\n    url(r'^docs/$', ApiBlueprintView.as_view(blueprint='/path/to/blueprint.apibp')),\n]\n```\n\n## Styling\n\n### Custom HTML Template\n\nDefine a custom base template. It must include the tag\n\n```\n{% include 'api_docs/docs_parent.html' %}\n```\n\nPass it into `ApiBlueprintView.as_view()` as a parameter.\n\n```python\nfrom apiblueprint_view.views import ApiBlueprintView\n\nurlpatterns = [\n    url(r'^docs/$', ApiBlueprintView.as_view(\n        blueprint='/path/to/blueprint.apibp',\n        template_name='my_base_template.html'\n    )),\n]\n```\n\n### Custom CSS\n\n`ApiBlueprintView.as_view()` may accept a `styles` dictionary describing custom CSS classes which should be attached to rendered HTML tags. For example:\n\n```python\nfrom apiblueprint_view.views import ApiBlueprintView\n\nurlpatterns = [\n    url(r'^docs/$', ApiBlueprintView.as_view(\n        blueprint='/path/to/blueprint.apibp',\n        template_name='my_base_template.html',\n        styles={\n            'action': {'class': 'foo bar'},\n            'method': {'class': 'baz'}\n        }\n    )),\n]\n```\n\nThe following keys are valid. All keys are optional:\n\n* `'action'`: Container `\u003cdiv\u003e` for an API action\n* `'action_transaction'`: Container `\u003cdiv\u003e` for a HTTP transaction (request and response)\n* `'action_request'`: Container `\u003cdiv\u003e` for a HTTP request\n* `'action_response'`: Container `\u003cdiv\u003e` for a HTTP response\n* `'action_schema'`: Container `\u003cdiv\u003e` for a HTTP request or response schema\n* `'action_headers'`: Container `\u003cdiv\u003e` for HTTP request or response headers\n* `'action_body'`: Container `\u003cdiv\u003e` for a HTTP request or response body\n* `'action_example'`: Container `\u003cdiv\u003e` for an API action example URL\n* `'description'`: Container `\u003cdiv\u003e` for some text describing an action, resource, request, response, etc\n* `'parameters'`: Container `\u003cdiv\u003e` for a list of parameters\n* `'method'`: Generic `\u003cspan\u003e` containing an HTTP method\n* `'method_CONNECT'`: `\u003cspan\u003e` containing the text `CONNECT`\n* `'method_DELETE'`: `\u003cspan\u003e` containing the text `DELETE`\n* `'method_GET'`: `\u003cspan\u003e` containing the text `GET`\n* `'method_HEAD'`: `\u003cspan\u003e` containing the text `HEAD`\n* `'method_OPTIONS'`: `\u003cspan\u003e` containing the text `OPTIONS`\n* `'method_PATCH'`: `\u003cspan\u003e` containing the text `PATCH`\n* `'method_POST'`: `\u003cspan\u003e` containing the text `POST`\n* `'method_PUT'`: `\u003cspan\u003e` containing the text `PUT`\n* `'method_TRACE'`: `\u003cspan\u003e` containing the text `TRACE`\n* `'resource'`: Container `\u003cdiv\u003e` for an API resource\n* `'resource_group'`: Container `\u003cdiv\u003e` for an API resource group\n\n[Highlight.js](https://highlightjs.org/) can be used to add syntax highlighting\n\n### Including Files\n\nYou can include other files in your blueprint by using an include directive with a path to the included file relative to the current file's directory. Included files can include other files, so be careful of circular references.\n\n```\n\u003c!-- include(filename.md) --\u003e\n```\n\nThis syntax is not a part of the API Blueprint spec, but is also supported in some other tools e.g: [aglio](https://github.com/danielgtaylor/aglio#including-files).\n\nThe include directive has the potential to introduce remote file inclusion or directory traversal vulnerabilities if your application renders user-supplied content. There are a couple of settings to help mitigate this. Set `APIBP_PROCESS_INCLUDES = False` in your django settings to completely ignore include directives (the default is `True`). There is also a whitelist of allowed file types to include. The default whitelist is `['.md', '.apibp', '.json']` but this can be overridden by setting `APIBP_INCLUDE_WHITELIST` to a list of allowed extensions in your django settings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris48s%2Fdjango-apiblueprint-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris48s%2Fdjango-apiblueprint-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris48s%2Fdjango-apiblueprint-view/lists"}