Scott-Wheeler / django-journey

My journey into Django
0 stars 0 forks source link

Django REST - 4.4 - adding login, object-level permissions, authenticating with API #140

Closed Scott-Wheeler closed 6 years ago

Scott-Wheeler commented 6 years ago

Part 4 of Django REST - 4 - Authentication & Permissions #135

Scott-Wheeler commented 6 years ago

the login doesn't work. I can't create snippets from the list view when authenticated. when logged in as the wrong user, the detail page accepts PUT, PATCH, DELETE

http -a other:otherpassword POST http://127.0.0.1:8000/snippets/ code="print(123)"
response is "Method Not Allowed"
grrrr
Scott-Wheeler commented 6 years ago

figured it out it's because I was using ListAPIView when I should have been using ListCreateAPIView