Skip to content
This repository was archived by the owner on Apr 3, 2022. It is now read-only.

Commit 12876fd

Browse files
committed
Added try...except logic for importing SimpleJSON external, then Pyton 2.6 json, then Django simpleJSON.
1 parent 241fde0 commit 12876fd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

twitter_app/views.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
import oauth, httplib, simplejson, time, datetime
1+
import oauth, httplib, time, datetime
2+
3+
try:
4+
import simplejson
5+
except ImportError:
6+
try:
7+
import json as simplejson
8+
except ImportError:
9+
try:
10+
from django.utils import simplejson
11+
except:
12+
raise "Requires either simplejson, Python 2.6 or django.utils!"
213

314
from django.http import *
415
from django.shortcuts import render_to_response

0 commit comments

Comments
 (0)