在我的 URLs.py 中,我正在这样设置我的 URL
url(r'^mobile/$', views.mobile, name='mobile')
导航到localhost:8000/mobile
按预期工作,但如果输入 URL:localhost:8000/mobile/hello/world/234234hjhf8sc3
它应该重定向到localhost:8000/mobile
但是这不会发生,因为我的正则表达式不正确(我不确定)
我怎么能这样做/正确的正则表达式是什么?
另一个例子是localhost:8000/mobile/send/help/as792lp
应该重定向到
localhost:8000/mobile