Home  >  Q&A  >  body text

python - web.py 的URL映射问题?

请问我需要在访问'xxx.com/app?id=123'的时候用App类去处理,那么在web.py里面设置的时候应该怎么设置呢?我写('/app?id=(\d+)', 'App')却说404。

巴扎黑巴扎黑2720 days ago278

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-04-17 17:46:24

    What follows the question mark does not belong to the url path

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 17:46:24

    The person above is right, the route only contains the one before the question mark
    Want to accept it? For the value of id=123, go to the routing function and accept it as a formal parameter

    def mycfunction(id):
         printf (id);

    reply
    0
  • Cancelreply