Carson Evans Carson Evans - 6 months ago 44
Python Question

Flask parameter converters 'int' object is not callable

I'm having issues using the flask parameter converter in even a simple app. No matter what I do I keep getting

TypeError: 'int' object is not callable

from flask import Flask

app = Flask(__name__)

def number(number):
return number

If I remove the
part of the parameter, it works fine. But I need it as an integer for later use.


You can't return a number from a Flask view.

return str(number)

Python will not automatically cast the int to a string.