Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flask - function mapping is overwriting an existing endpoint function

Tags:

I am trying to get the flask framework to work with Facebook. I'm doing this with flask_canvas. I followed the example for flask_canvas in the documentation (found here: http://flask-canvas.readthedocs.org/en/latest/) but I keep getting the following error:

AssertionError: View function mapping is overwriting an existing endpoint function: inner

If I comment out the method user(), it will run, but when that method is not commented out, I get the above error.

Any idea how to make it so I can have both the canvas() and user() methods without getting an AssertionError thrown?

import flask_canvas
from flask import Flask, session, redirect
app = Flask(__name__)
flask_canvas.install(app)

HOST = 'localhost'
PORT = 8000

@app.route('/')
def hello_world():
    return 'Hello World!'

# route your canvas-specific page
@app.canvas_route('/app/', methods=['GET','POST'])
def canvas():
    return 'hello, world'

 #route page requiring user data
@app.canvas_route('/user/', methods=['GET','POST'])
def user(canvas_user):
    return canvas_user.request('/me')

if __name__ == '__main__':
    app.run(host = HOST, port = PORT, debug = True)