Skip to content

Instantly share code, notes, and snippets.

@fcurella
fcurella / json_response.py
Created December 30, 2010 04:02
A little decorator that allows you to return a dict in your views instead of render_to_response or HttpResponse or whatever. It respects the callback argument for proper JSONP action if you so choose.
from django.http import HttpResponse
from decorator import decorator
import simplejson as json
@decorator
def json_response(f, *args, **kwargs):
try:
status_code = 200
response = {
'status': True,
======================================================
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