from django.http import HttpResponse def model_documentation(models_module, model_names): doc = '

Models

\n' for model_name in model_names: model_class = getattr(models_module, model_name) doc += '

%s

\n' % model_name doc += '
\n%s
\n' % model_class.__doc__ return HttpResponse(doc)