Skip to content

Instantly share code, notes, and snippets.

View heyman's full-sized avatar

Jonatan Heyman heyman

View GitHub Profile
@heyman
heyman / gist:3744010
Created September 18, 2012 16:12
Generic Django JSON view class with JSONP support
try:
import simplejson as json
except ImportError:
import json
from django.views import generic
from django.http import HttpResponse
class JsonView(generic.View):
"""
@heyman
heyman / s3botostorage.py
Created August 9, 2012 11:31 — forked from tbarbugli/s3botostorage.py
S3BotoStorage
from boto.utils import parse_ts
from django.core.files.storage import get_storage_class
from storages.backends.s3boto import S3BotoStorage
"""
make sure you have this setting
AWS_PRELOAD_METADATA = True
and that you have python-dateutils==1.5 installed
"""
@heyman
heyman / geventmongo.py
Created November 16, 2011 09:47 — forked from gwik/geventmongo.py
PyMongo >=2.0 pool for gevent
# Copyright 2011 10gen
#
# Modified by Antonin Amand <[email protected]> to work with gevent.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#