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

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

巴扎黑
巴扎黑

répondre à tous(2)
小葫芦

问号后面的不属于url路径

左手右手慢动作

楼上说的对,路由只写问号前面的
想接受?id=123 的值那就到这个路由的函数里给个形参接受

def mycfunction(id):
     printf (id);
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!