[Django]-405 POST method no allowed on heroku with django

0👍

I don’t know if this is the exact cause of your error, but when using a decorator on an instance method, you have to wrap it in the @method_decorator call. So your dispatch function should look like this instead:

from django.utils.decorators import method_decorator

@method_decorator(csrf_exempt)
def dispatch(self,*args,**kwargs):
    return super(ApplyForRental, self).dispatch(*args,**kwargs)

https://docs.djangoproject.com/en/1.7/topics/class-based-views/intro/#decorating-the-class

Leave a comment