Django

Code

root/django/branches/gis/django/contrib/gis/shortcuts.py

Revision 6108, 0.5 kB (checked in by jbronn, 1 year ago)

gis: added the beginnings of a maps module, for generating mapping framework JavaScript?; cleaned up the sitemaps module and KML templates; added shortcuts module.

Line 
1 from django.http import HttpResponse
2 from django.template import loader
3
4 def render_to_kml(*args, **kwargs):
5     "Renders the response using the MIME type for KML."
6     return HttpResponse(loader.render_to_string(*args, **kwargs),
7                         mimetype='application/vnd.google-earth.kml+xml kml')
8
9 def render_to_text(*args, **kwargs):
10     "Renders the response using the MIME type for plain text."
11     return HttpResponse(loader.render_to_string(*args, **kwargs),
12                         mimetype='text/plain')
Note: See TracBrowser for help on using the browser.