Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- twitter.html:
- {% block sidebar %}
- {% for status in statuses %}
- <div>{{ status.user.name }}</div>
- <div>{{ status.text }}</div>
- {% endfor %}
- {% endblock %}
- twitterHandler:
- class TwitterHandler(BaseHandler):
- def get(self):
- api = twitter.Api(username ='username', password='password')
- statuses = api.GetFriendsTimeline('username')
- args = {'statuses':statuses}
- path = os.path.join(os.path.dirname(__file__), 'templates','twitter.html')
- self.response.out.write(template.render(path, args))
- blog.html:
- {% extends "twitter.html" %}
- {% block content %}
- <div id='blog'>
- {% for post in posts %}
- <h2>{{ post.title }}</h2>
- <div class="post">{{ post.body }}</div>
- {% endfor %}
- </div>
- {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement