Re: [flask] Question on add_url_rule and routes
- Steven Kryskalla
- 2013-07-06 @ 17:53
On Sat, Jul 6, 2013 at 10:31 AM, Harihara Vinayakaram <email@example.com> wrote:
> def hello:
That is not valid python, a function definition always has a list of
arguments. Also, since you defined this method inside of a class,
"self" needs to be first parameter of the method.
> class = MyClass()
> app.add_url_rule('/', 'class.hello', class.hello)
This does not work either, "class" is a keyword in python can not be
used as a variable name.
You can turn debug mode on to see what errors you're getting: