Sphinx documentation integration with django

I created sphinx documentation for a django project. He created the build folder html folder and index.html file. What I'm not sure about is how to integrate the index.html file into my project. Is it possible to simply add it to the url configuration and how will it be formatted?

+6
source share
2 answers

IMO, the β€œbest” way to do this is simply at the HTTP server level, and not in Django itself (at least not as I did in the past). You do not need or do not need any parts of the Django layer to work with your sphinx documents, you just need to set up the vanilla web server to do this.

In addition, it can help. Django refers directly to the html template if you insist on using Django ... but again, I would vote for simply setting up / docs the directory under your root and pointing it to the sphinx data through the basic Apache / configuration NGINX / etc.

+1
source

There are some good examples of using dhdx integration in Django:

  • Allow dynamic content in documentation (e.g. username, current time, etc.).
  • Integration of documentation with a common site map.
  • Create and maintain only one set of templates / CSS files.

If you have one or more of these needs, I would look at the django-sphinxdoc , it handles all the basic options for using out of the box, but can be easily modified.

+5
source

Source: https://habr.com/ru/post/955476/


All Articles