it/itf/frontpage/views.py
2011-10-08 03:03:05 -04:00

19 lines
499 B
Python
Executable File

# Create your views here.
from django.shortcuts import render_to_response
from models import *
from settings import TWITTER_ID
import twitter
from django.template import RequestContext
def index(request):
try:
tApi = twitter.Api()
statuses = tApi.GetUserTimeline(TWITTER_ID)
except:
statuses = []
boxes = SliderBox.objects.all()
return render_to_response("noel/index.html", RequestContext(request, {
'tweets': statuses[0:5],
'boxes': boxes
}))