Skip to content

Instantly share code, notes, and snippets.

View philipn's full-sized avatar

Philip Neustrom philipn

View GitHub Profile
cspanring /
Created February 8, 2012 18:25
Add GeoJSON support for geometry fields in django-tastypie
# Shamelessly stolen from
from django.contrib.gis.db.models import GeometryField
from django.utils import simplejson
from tastypie.bundle import Bundle
from tastypie.fields import ApiField, CharField
from tastypie.resources import ModelResource
vicalejuri /
Created June 5, 2010 17:47
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
import settings