2011-08-01 13:49:19 +00:00
|
|
|
# Create your views here.
|
|
|
|
from django.shortcuts import render_to_response
|
|
|
|
from models import *
|
|
|
|
from settings import TWITTER_ID
|
|
|
|
import twitter
|
2011-08-03 15:57:53 +00:00
|
|
|
from django.template import RequestContext
|
2011-08-01 13:49:19 +00:00
|
|
|
|
|
|
|
def index(request):
|
2011-08-09 19:18:26 +00:00
|
|
|
try:
|
|
|
|
tApi = twitter.Api()
|
|
|
|
statuses = tApi.GetUserTimeline(TWITTER_ID)
|
|
|
|
except:
|
|
|
|
statuses = []
|
2011-08-01 13:49:19 +00:00
|
|
|
boxes = SliderBox.objects.all()
|
2011-08-03 15:57:53 +00:00
|
|
|
return render_to_response("noel/index.html", RequestContext(request, {
|
2011-08-01 13:49:19 +00:00
|
|
|
'tweets': statuses[0:5],
|
2011-08-09 19:30:07 +00:00
|
|
|
'boxes': boxes
|
2011-08-03 15:57:53 +00:00
|
|
|
}))
|