At a guess, you are not running latest mod_wsgi 2.X version and are using Opera browser.
There is a known issue with Opera and its use of HTTP 100-continue when using mod_wsgi daemon mode. This issue was fixed in mod_wsgi 2.4.
Since though you don't say what version of mod_wsgi you are using, nor which browser you are using, this is only a guess.
Ok, so once again we come down to user error. At some point the problem changed because I changed some of the code above, so that
def post_authentication_api(request):
became
def post_authentication_api(self, request):
this doesnt work because as Graham said at the django mailing list
"If you ... have a 'self' first argument for a function which
isn't a method of a class, it is obvious you are going to get:"
Exception Type: TypeError at /auth/post_authentication_api
Exception Value: post_authentication_api() takes exactly 2 arguments
(1 given)
So after I fixed that up I came to the root of the problem (as far as I can tell) which was that wsgi was blocking sys.stdout. which I think seems fair to me, and I had some print statements in my code and this is why it wasnt running. A very simple problem that for some reason became very complicated.
Anyway, Great thanks to Graham who has helped me out for the last week on this. He has been tireless and very accommodating to someone who is quite embarrassed about the final outcome. Some votes will be coming his way for the comments and my many thanks as well.
Thanks again
Mark
Best Answer
Use WSGIRestrictStdout option:
or replace sys.stdout with sys.stderr in Django WSGI star script:
Writing To Standard Output