Skip to content

Instantly share code, notes, and snippets.

@gu-fan
Created July 13, 2014 15:09
Show Gist options
  • Save gu-fan/85acc933f126cfeb1f42 to your computer and use it in GitHub Desktop.
Save gu-fan/85acc933f126cfeb1f42 to your computer and use it in GitHub Desktop.
from flask import Flask, render_template, request
# from flask.ext.socketio import SocketIO, emit
import os
import rstdoc
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
app.debug = True
@app.route("/", methods=['GET','PUT','POST'])
def index():
print request.method
if request.method == 'PUT' or request.method == 'POST':
print request.data
print request.__dict__
return render_template('index.html')
if __name__ == '__main__':
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment