Saturday 15 August 2015

python - AssertionError: View function mapping is overwriting an existing endpoint function: main -


Does anybody know why I can not overwrite existing endpoint function if I have two such types of URL rules are

  app.ad_url_ul ('/', visible_function = man.as_view ('main'), methods = ["GET"]) app. Add_url_rule ('/ & lt; page & gt; /', view_func = main. Traceback:  
  traceback (most recent call final): "demo.py" ("main") , Methods = ["GET"])   

", line 20, & lt; modules & gt; methods = [" GET "]) file" ... / python2.6 / Site-packages / flaskâ "???? / app.py", line 62, wrapper_func Returns the file (itself, * args, ** kwargs) in the file "... / python2.6 / site-packages / flaskâ"? ??? AssertionError: function mapping overwriting an existing endpoint function: /

The name of your view should be unique, even if they are pointing to the same visual method.

  app.add_url_rule ('/', view_func = main .as_view ('main'), methods = ['GET']]    ) app. Add_url_rule ('/ & lt; page & gt; /', view_func = main.as_view ('page'), methods = ['GET' ])

No comments:

Post a Comment