When requesting[GET] 127.0.0.1:8000/restaurant/1 i get a clean json and 200 status code
urlpatterns = [
url(r'^restaurant',views.Restaurant_List_Create.as_view(), name='all_restaurants'),
url(r'^restaurant/(?P<pk>\d+)',views.Restaurant_Retrive.as_view(), name='specified_restaurant'),
]
but when i interchange the url codes it runs the views.Restaurant_List_Create.as_view() (overrides the regex url)
urlpatterns = [
url(r'^restaurant/(?P<pk>\d+)',views.Restaurant_Retrive.as_view(), name='specified_restaurant'),
url(r'^restaurant',views.Restaurant_List_Create.as_view(), name='all_restaurants'),
]
You url matches both because you don't have included $ sign at the end of your urls.
You can change them as follow :
urlpatterns = [
url(r'^restaurant/(?P<pk>\d+)$',views.Restaurant_Retrive.as_view(), name='specified_restaurant'),
url(r'^restaurant$',views.Restaurant_List_Create.as_view(), name='all_restaurants'),
]