I am new in Django REST framework. Can someone explain why I get such error, if I make a POST request to \'/api/index/\'
405 Method Not Allowed
{\"detail\":\
Make sure that you have "POST" in http_method_names
. Alternatively, you can write it like this:
def allowed_methods(self):
"""
Return the list of allowed HTTP methods, uppercased.
"""
self.http_method_names.append("post")
return [method.upper() for method in self.http_method_names
if hasattr(self, method)]