python - web.py 的URL映射问题?
巴扎黑
巴扎黑 2017-04-17 17:44:24
0
2
268

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

巴扎黑
巴扎黑

reply all(2)
小葫芦

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

左手右手慢动作

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);
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!