def back(): code = request.args.get('code', '') error = request.args.get('error', '') if code: return st('index.html', **locals()) elif error: return error else: return 'Unkonw Error'
def index(): if request.method == 'POST': md_content = request.form['md_content'] html = Markup(render(md_content)) return st('index.html', **locals())
def login(): client = DoubanClient(API_KEY, API_SECRET, CALLBACK, SCOPE) auth_url = client.authorize_url return st('login.html', **locals())