지금까지 django-rest-swagger은 v0.1.10의 Markdown 구문에서 docstring을 지원합니다. 그러나 문서를 보려고하면 구문 분석 대신 HTML 코드로 변환하는 대신 일반 텍스트로 표시됩니다.django-rest-swagger가 Markdown 문서 문자열을 HTML 코드로 구문 분석/변환하지 않습니다
내가 사용하고 있습니다 :
Django==1.5
Markdown==2.3.1
djangorestframework==2.3.10
django-rest-swagger==0.1.11
SWAGGER_SETTINGS = {
"exclude_namespaces": [], # List URL namespaces to ignore
"api_version": '0.1', # Specify your API's version
"api_path": "", # Specify the path to your API not a root level
"enabled_methods": [ # Specify which methods to enable in Swagger UI
'get',
'post',
'put',
'patch',
'delete'
],
"api_key": '', # An API key
"is_authenticated": True, # Set to True to enforce user authentication,
"is_superuser": False, # Set to True to enforce admin only access
}
API 샘플 코드 기능 기반 뷰 :
이 API를 직접 탐색 할 때, 설명을 번역@api_view(['POST'])
def dummy(request):
'''
Lorem ipsum `dolor` sit amet, consectetur adipiscing elit. Etiam sodales lacus at _nulla_ fringilla fringilla.
### Consectetur adipiscing:
* __dummy_var__: Nunc ut erat justo. Duis turpis augue, posuere a ornare sed,
* another: Vestibulum suscipit congue neque sed faucibus.
* `code`: Cras sit amet ullamcorper ipsum.
'''
pass
/렌더링을 정확히.
오전 내가 모르는 뭔가가?
당신이 당신의 질문에 태그 장고 - 나머지 프레임 워크를 추가시겠습니까? 감사. – cezar
오른쪽! 감사합니다 @ cezar – trinchet