我无法通过应用程序让Sphinx为我的Django项目生成自动文档。 models.py
个文件。当我运行make html
时,我收到了警告
WARNING: toctree contains reference to nonexisting document u'modules/models'
我的目录设置是:
.../www/proj/manage.py
/proj/settings.py
/urls.py
...
/myapp1/models.py
/views.py
...
/docs/Makefile
/build/
/modules/models.rst
/source/conf.py
/index.rst
...
index.rst
的相关位是:
Documentation for qdb
=====================
Contents:
.. toctree::
:maxdepth: 2
modules/models
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
modules/models.rst
是:
Models
======
.. automodule:: myapp1.models
:members:
来自conf.py
的位是:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
from django.conf import settings
settings.configure()
我也尝试过:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'qdb.settings'
但这也不起作用。如何告诉Sphinx在哪里找到modules/models.rst
?
[我在Python 2.7上,Django 1.8,Sphinx 1.3.1]