Using Django's builtin documentation

1 view
Skip to first unread message

Rufman

unread,
Oct 11, 2007, 6:02:11 AM10/11/07
to Django users
Django uses docutils and restructured text for the documentation of
the admin. How can i get my own documentation of my views and models
(restructured text) to show on the documentation page in the django
admin (dashboard -> documentation)?

Just out of interest: Does anyone know how the core of the django
automatic documentation works (link to a tutorial)?

thx for the help


Stephane

James Bennett

unread,
Oct 11, 2007, 11:11:55 AM10/11/07
to django...@googlegroups.com
On 10/11/07, Rufman <stepha...@gmail.com> wrote:
> Django uses docutils and restructured text for the documentation of
> the admin. How can i get my own documentation of my views and models
> (restructured text) to show on the documentation page in the django
> admin (dashboard -> documentation)?

It's generated from the docstrings, so if you're following good Python
practice of writing docstrings in your code you'll see them show up in
the admin as documentation.

--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Jeremy Dunck

unread,
Oct 11, 2007, 11:16:15 AM10/11/07
to django...@googlegroups.com
On 10/11/07, James Bennett <ubern...@gmail.com> wrote:
>
> On 10/11/07, Rufman <stepha...@gmail.com> wrote:
> > Django uses docutils and restructured text for the documentation of
> > the admin. How can i get my own documentation of my views and models
> > (restructured text) to show on the documentation page in the django
> > admin (dashboard -> documentation)?
>
> It's generated from the docstrings, so if you're following good Python
> practice of writing docstrings in your code you'll see them show up in
> the admin as documentation.

...Except that attributes are lost when functions are decorated. :)

What a handy example for the patch here:
http://code.djangoproject.com/ticket/5701

:)

N.B. There is some doubt that the included patch will be included in
Django due to provenance issues with the copied functools code. There
is a current thread on django-dev regarding this.

Jeremy Dunck

unread,
Oct 11, 2007, 11:17:05 AM10/11/07
to django...@googlegroups.com
On 10/11/07, Jeremy Dunck <jdu...@gmail.com> wrote:
> N.B. There is some doubt that the included patch will be included in
> Django due to provenance issues with the copied functools code. There
> is a current thread on django-dev regarding this.

archive of thread:
http://groups.google.com/group/django-developers/browse_thread/thread/885ed68f98f8258d

Rufman

unread,
Oct 12, 2007, 8:44:39 AM10/12/07
to Django users

>
> It's generated from the docstrings, so if you're following good Python
> practice of writing docstrings in your code you'll see them show up in
> the admin as documentation.
>

I read somewhere, that django automatically creates the documentation
for the variables passed to a template. Is there some function i have
to activate or is this not possible?

James Bennett

unread,
Oct 12, 2007, 11:55:09 AM10/12/07
to django...@googlegroups.com
On 10/12/07, Rufman <stepha...@gmail.com> wrote:
> I read somewhere, that django automatically creates the documentation
> for the variables passed to a template. Is there some function i have
> to activate or is this not possible?

Django doesn't automatically generate _any_ documentation. All it does
is show what's in the docstrings, so your docstring should list the
variables and what they are.

Reply all
Reply to author
Forward
0 new messages