|
|
@ -9,6 +9,7 @@ from django.forms.widgets import Textarea |
|
|
|
from django.utils.html import urlize |
|
|
|
from django.core.mail import send_mail |
|
|
|
from django.views.decorators.cache import cache_page |
|
|
|
from utils import get_latest_tweets |
|
|
|
|
|
|
|
class ContactForm(forms.Form): |
|
|
|
name = forms.CharField(max_length=255) |
|
|
@ -36,14 +37,13 @@ class ContactForm(forms.Form): |
|
|
|
#@cache_page(60 * 30) |
|
|
|
def index(request): |
|
|
|
try: |
|
|
|
tApi = twitter.Api() |
|
|
|
statuses = tApi.GetUserTimeline(TWITTER_ID)[0:3] |
|
|
|
statuses = get_latest_tweets() |
|
|
|
except: |
|
|
|
statuses = [] |
|
|
|
boxes = SliderBox.objects.filter(is_displayed=True) |
|
|
|
front_images = FrontImage.objects.filter(is_active=True)[0:3] |
|
|
|
return render_to_response("noel/index.html", RequestContext(request, { |
|
|
|
'tweets': [urlize(s.text) for s in statuses], |
|
|
|
'tweets': [urlize(s['text']) for s in statuses], |
|
|
|
'boxes': boxes, |
|
|
|
'front_images': front_images |
|
|
|
})) |
|
|
|