This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2, json, random, sys | |
from flask import Flask, request, make_response | |
app = Flask(__name__) | |
TIMELINE_DATA = None | |
@app.route('/public_timeline.json') | |
def public_timeline(): | |
out = json.dumps(sorted(TIMELINE_DATA, key=lambda x: random.random())) | |
if 'callback' in request.args: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### urls.py ### | |
from django.conf.urls.defaults import * | |
from views import * | |
urlpatterns = patterns('', | |
url(r'^view1/$', view1, name='view1'), | |
url(r'^view2/$', view2, name='view2'), | |
) |
NewerOlder