【发布时间】:2015-03-22 11:54:12
【问题描述】:
我正在为我的 API 网址使用这种语法:
http://myhost/myapiname/X-Y-Z/web-service-name/
在 Django urls.py 中,它看起来像这样:
url(r'api_s/2-0-0/get_client_profile/$', GetClientProfile.as_detail(), name='get_client_profile'),
现在,我想将所有 1-0-0 网址(已弃用的网络服务)重定向到特定视图。
我尝试了类似url(r'api_t/1-0-0*$', Deprecated.as_list(), name='deprecated') 的方法,但无法捕获。我不习惯 REGEX,所以我在这里遗漏了一些东西。谢谢。
【问题讨论】: