o _@sxddlZddlmZddlmZddlmZddlmZzddl Z Wn e y-dZ YnwddZ d d Z d d Z dS) N)BytesIO)settings) HttpResponse)loaderFcCs\t}t|dtj}|d|tjWdn1s wY|d| S)z0Return compressed KMZ from the given KML string.azdoc.kmlNr) rzipfileZipFile ZIP_DEFLATEDwritestrencoderDEFAULT_CHARSETseekread)kmlkmzzfr>/usr/lib/python3/dist-packages/django/contrib/gis/shortcuts.py compress_kmls  rcOsttj|i|ddS)z9Render the response as KML (using the correct MIME type).z$application/vnd.google-earth.kml+xml content_type)rrrender_to_stringargskwargsrrr render_to_kmlsrcOstttj|i|ddS)zW Compress the KML content and return as KMZ (using the correct MIME type). z application/vnd.google-earth.kmzr)rrrrrrrr render_to_kmz sr)rior django.confr django.httprdjango.templaternumpy ImportErrorrrrrrrrs