Django REST framework: method PUT not allowed in ViewSet with def update()

PUT needs id in URL by default

Sometimes there is the difference between POST and PUT, because PUT needs id in URL
That’s why you get the error: “PUT is not Allowed“.

Example:

  • POST: /api/users/
  • PUT: /api/users/1/

Hope it’ll save a lot of time for somebody

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)