如何将Sphinx生成的html文档集成进入Django

参考

  • http://stackoverflow.com/questions/10594618/django-and-sphinx-how-to-view-the-html-sphinx-generates
#step 1:添加URL映射
url(r'^docs/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.DOCS_ROOT}), url(r'^docs/', 'django.views.static.serve', {'document_root': settings.DOCS_ROOT, 'path': 'index.html'}),
#step 2:settings.py 中添加配置项
DOCS_ROOT = os.path.join(BASE_DIR, 'static', 'Sphinx')
#step 3:将Sphinx的html文件拷入上一步设置的路径
posted @ 2017-01-05 09:38  flowjacky  阅读(704)  评论(0编辑  收藏  举报