简体   繁体   中英

How to generate documentation from Django models?

At the moment we use Sphinx for project documentation and Django models field description.

The main problem is that: after changing models, we manually updated Sphinx docs and sometimes forget/miss some fields in docs.

Is there some tool for generate docs based on Django models?

The documentation says:

Django's documentation uses the Sphinx documentation system, which in turn is based on docutils. The basic idea is that lightly-formatted plain-text documentation is transformed into HTML, PDF, and any other output format.

So you should just use sphinx to generate the doc for your django application. You should activate pulling documentation from docstrings in sphinx using the autodoc extension, to activate put this in your conf.py for sphinx:

extensions = [
    'sphinx.ext.autodoc',
]

为Django生成文档的最佳方法-使用admindocs 应用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM