We had a need the other week to churn out the skeleton of a site to see how the different areas fitted together.
As the thing was being written in Django anyway I put together this quick ‘n dirty utility that renders the reStructuredText docstring of a view to the returned response, so you can quickly put in page furniture and links to other views without having to go to the effort of creating templates.
Better still, as it’s implemented as a decorator on the method, it’s easy to swap out once you get around to writing the actual view code.


def docview(fn):
    from docutils.core import publish_string
    from django.http import HttpResponse

    r = HttpResponse(publish_string(
            source=fn.func_doc,
            writer_name='html'))
    
    return lambda rtn: r

Then decorate your method:


@docview
def fast_view(request):
    """
===========
A Fast View
===========

With links to:

 * `An even faster view </faster_view>`_
 * `Somewhere else <http://google.co.uk>`_
 
    """

Which will render something like:

A Fast View

With links to: