On Thursday, March 21, 2019 at 10:28:30 AM UTC+1, Manlio Perillo wrote:
>
> I have a Django application that works perfectly fine both on my PC and on 
> a hosting system with CloudLinux and Passenger.
> However when I added a form with a file field, I started to get 404 errors 
> on POST.
>
> I tried to remove all the middleware, but the problem is still here.
> The error message says that the 404 error was raised by my view, but 
> that's not true; my view is not called at all during a POST request.
>
> What's strange is that I have another Django application on a different 
> hosting account with the same environment and it works fine.
> The problem is probably in my application, but I'm unable to find it.
>
> Where should I search to find the cause of the problem?
>
>
The problem was caused by Passenger.
https://stackoverflow.com/questions/49594955/django-1-11-on-passenger-wsgi-not-routing-post-request?rq=1

Unlike the case from the stackoverflow question, in my case PATH_INFO was 
incorrectly set only for POST requests containing files.
The fix suggested solved the problem.


Regards
Manlio Perillo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6ce75e7b-6f3c-4c3a-a636-186d4de52d75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to