Reputation: 139
Project level urls.py
urlpatterns += [
url(r'^machines/api/', include('core.urls')),
url(r'', include('apps.api.urls')),
url(r'^machines', include('apps.machines.urls')),]
App level urls.py
urlpatterns = [
url(r'^user/edit/(?P<pk>[0-9]+)/$', core_view.ProfileEdit.as_view()),
url(r'^group/', core_view.GroupList.as_view()),
url(r'^groups/add/', core_view.GroupCreate.as_view()),]
when i hit http://localhost:8000/machines/api/groups/add
it is calling GroupList
view instead of GroupCreate
.
I am not getting any reason why this is happening?
Upvotes: 2
Views: 108
Reputation: 47354
Current url list triggered GroupList
on each url started with group/
. You should add $
at the end of GroupList pattern to limit url triggered by GroupList only with group
:
url(r'^group/$', core_view.GroupList.as_view()),
url(r'^groups/add/', core_view.GroupCreate.as_view()),]
Upvotes: 1