Skip to content

Instantly share code, notes, and snippets.

View gregnewman's full-sized avatar

Greg Newman gregnewman

View GitHub Profile
from mimetypes import guess_type
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import Storage
from django.utils.encoding import iri_to_uri
import re
try:
import S3
except ImportError:
raise ImproperlyConfigured, "Could not load amazon's S3 bindings.\
from mimetypes import guess_type
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import Storage
from django.utils.encoding import iri_to_uri
import re
try:
import S3
except ImportError:
raise ImproperlyConfigured, "Could not load amazon's S3 bindings.\
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
# install pinax 0.7beta2 on ubuntu 9.04
sudo aptitude install python-setuptools
sudo aptitude install python-imaging
wget http://downloads.pinaxproject.com/pinax-0.7beta2.tar.gz
tar zxvf pinax-0.7beta2.tar.gz
python pinax-0.7beta2/scripts/pinax-boot.py pinax-env
echo "/usr/lib/python2.6/dist-packages/" > pinax-env/lib/python2.6/site-packages/fuck-ubuntu.pth
source pinax-env/bin/activate
pinax-admin clone_project social_project mysite
#!/usr/bin/env python
# encoding: utf-8
import demjson
from pprint import pprint
import urllib2
def main():
user = "jeremybanks"
userJSON = urllib2.urlopen("http://github.com/api/v1/json/%s/" % user).read()
user = demjson.decode(userJSON)["user"]