Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku and Django with 405 error

I am trying to move my django project from an apache setup over to heroku. At this point, everything seems to be working fine except for an issue I am having with using the PATCH Http Method (which I use in conjuction with django-tastypie).

I have a piece of middleware that allows this method and it worked on the apache server I had before. Now all I get is a 405 (METHOD_NOT_ALLOWED) error. The common HTTP methods still work (GET, POST, DELETE, POST). I also have read that nginx doesn't support OPTIONS (and maybe PATCH requests?) by default and some configuring has to be done. From what I have read, nginx returns a similar 405 error for OPTIONS method requests. I am also pretty sure heroku uses an nginx frontend, so that could be the issue.

This leads me to my next issue: I have no idea how to add my own headers to it because that is all controlled by heroku. Does anyone know exactly what the issue is? Is there any way, aside from abandoning the PATCH method (which makes things much more convenient), to get the PATCH method to work on heroku?

like image 231
tonyl7126 Avatar asked Apr 09 '12 06:04

tonyl7126


1 Answers

Patch is currently not supported on Heroku. It is not due to an nginx issue, but rather due to an issue in the routing layer. It is something Heroku is currently working on, but there is no ETA on it being available. Additionally you do not have the ability to add custom headers as these are controlled for you.

like image 133
CraigKerstiens Avatar answered Oct 29 '22 15:10

CraigKerstiens