Heroku and Django with 405 error

I am trying to migrate a django project from installing apache to heroku. Everything is working fine right now, except for the problem that I am encountering using the PATCH Http method (which I use in conjunction with django-tastypie).

I have a piece of middleware that this method allows, and it worked on the Apache server that I had before. Now I get error 405 (METHOD_NOT_ALLOWED). General HTTP methods still work (GET, POST, DELETE, POST). I also read that nginx does not support OPTIONS by default (and perhaps PATCH requests?), And some configuration needs to be done. From what I read, nginx returns a similar 405 error for OPTIONS method requests. I am also sure that the heroine uses the nginx interface, so this can be a problem.

This leads me to the following question: I have no idea how to add my own headings to it, because all this is controlled by the hero. Does anyone know exactly what the problem is? Is there any way other than abandoning the PATCH method (which makes things much more convenient) to make the PATCH method work for the hero?

+8
django heroku tastypie
source share
1 answer

The patch is currently not supported on Heroku. This is not due to the nginx problem, but to the problem related to the routing level. This is what Heroku is currently working on, but ETA does not exist. In addition, you are not able to add custom headers, as they are controlled for you.

+8
source share

All Articles