【发布时间】:2016-05-15 15:20:39
【问题描述】:
我有以下网址模式。
urlpatterns = [
url('^$', views.IndexView.as_view(), name='index'),
url('^api/create_workplace$', views.create_workplace, name='create_workplace'),
url('^api/create_workplace/(?P<get_all>\w+)/$', views.get_workplaces, name='get_workplaces')
]
但是当我添加 get_all 参数时,总是调用create_workplace 方法。
是否可以用相同的url调用不同的方法 取决于参数?
【问题讨论】: