sphinx inside

27 views
Skip to first unread message

Kai Kobschätzki

unread,
Apr 30, 2020, 4:00:14 PM4/30/20
to Django users
Hi,

I installed sphinx and I get an documentation in
project_main/docs/_build/html, starting with html/index.html. In so far
- fine.

Now I want to present this documents inside my project so I can see in
the nav-bar a "doc" where I can see them. But I have no idea how to
start it. I tried it with a simple function in a view inside an app, but
then I need a symbolic-link for getting the index.html, but then I can't
get the rest of the documentation.

I tried to google it but I only find tutorials for using sphinx to make
a documentation for the django-project but I didn't find a tip how I can
realize it.

Could anyone give a kick-off for it or a link for a tutorial? Perhaps I
have only the wrong keywords..

Greetings

bengoshi



Amit Gupta

unread,
Apr 30, 2020, 8:00:27 PM4/30/20
to django...@googlegroups.com
Hii 
If u want to just add your file in your django project u can probably copy and paste the file in your project file and after that you can successfully use your file in the project by just writing the name of  your file with correct extension

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/17689333-b06c-1dfc-1f18-341689914c42%40gmail.com.

Kai Kobschätzki

unread,
May 1, 2020, 4:10:07 AM5/1/20
to django...@googlegroups.com

Hi Amit,

thanks for your response. But in this way, I can't use the sphinx templates, the links are not correct and after every new make html (or using sphinx-autobuild) I have to copy the changed or new files. Are there no more likable way?

Greetings

bengoshi

Motaz Hejaze

unread,
May 1, 2020, 10:27:04 AM5/1/20
to Django users
Make a view that returns a template only , and give it a url

Kai Kobschätzki

unread,
May 1, 2020, 4:02:59 PM5/1/20
to django...@googlegroups.com

I tried a

path('docs/', TemplateView.as_view(template_name="docs/html/index.html"))

then I can see the index.html but without css and no link works..

Greetings

bengoshi

Michael Rohan

unread,
May 1, 2020, 5:51:09 PM5/1/20
to Django users
Hi,

I believe it's probably easiest to simply create the Sphinx html files in one of the static directories (probably should add to the top level one if you have one, or one of the apps if the docs are app specific) and just let the static file handling serve them.  You could use whitenoise to have Django serve them (if you want to go that route).

Take care,
Michael.

On Friday, May 1, 2020 at 1:02:59 PM UTC-7, bengoshi wrote:

I tried a

path('docs/', TemplateView.as_view(template_name="docs/html/index.html"))

then I can see the index.html but without css and no link works..

Greetings

bengoshi

On 5/1/20 4:25 PM, Motaz Hejaze wrote:
Make a view that returns a template only , and give it a url

To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

Motaz Hejaze

unread,
May 1, 2020, 6:47:38 PM5/1/20
to Django users
Inspect the generated sphinx html , load the static using django

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/692d8b57-8103-4f2b-9ad9-c8390194ac26%40googlegroups.com.

Kai Kobschätzki

unread,
May 3, 2020, 4:09:30 AM5/3/20
to django...@googlegroups.com

thanks for your response!

Greetings

bengoshi

Reply all
Reply to author
Forward
0 new messages