The short answer is that Django templates are format agnostic. They
don't know anything about HTML so you can output pretty much anything
that looks like text from a template.

But if what you are returning is *not* HTML, remember to set the
optional 'mimetype' param to HttpResponse. For example, I have a class
called Taconite (which works very nicely for doing AJAX via
jQuery.taconite). It returns XML, so its response method is:
            def response(self):
                return HttpResponse(self.render(),
mimetype='application/xml')

Generating non-text-format responses is a different matter, and it
takes you away from the in-the-box template mechanism altogether. I
would suggest returning RTF and letting the user do their own
conversion to whatever.

One last comment: Django's templating system is not tightly bound to
the rest of Django (with the exception of the admin/forms modules). As
long as a view returns an HttpResponse object, then you can do
anything that solves your problem. That means you can create your own
universe of templates and templating languages and still use Django
for the overall framework. This also means it's trivial to mix-and-
match, with each view using the templating mechanism that is most
suited to the task.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to