I'm getting an issue with a person agent designed in Python that i'm now attempting to use having a Bitnami Amazon . com Web Service which has Apache, mod_wsgi (for Python), and Django pre-installed. I'm getting an issue when attempting to Publish data towards the Django site in the Python user agent.

For example, after i assemble an URL using the following:

    rq = urllib2.Request('http://' + IP_ADDRESS + '/power/command/')
    r = urllib2.urlopen(rq)
    return r.read()

This GET isn't any problem. After I assemble an URL the following, but attempt to Publish data by using it, like so:

        params = urlencode({'u': json.write(obj)})
        rq = urllib2.Request('http://' + IP_ADDRESS + '/power/command/update/', params)
        r = urllib2.urlopen(rq)
        ret_val = r.read()

I recieve a 404 error. Basically simply take away the params in the Request constructor, I recieve a 500 error – which seems appropriate.

These two segments of code work all right using the Django debug webserver('./manage.py runserver') that's a part of Django. Any applying for grants the issue, as well as precisely how to debug are appreciated.

I've already attempted to spoof the 'User-agent', but this does not appear likely because the GET works first and foremost. The Apache httpd.conf file appears pretty stock aside from the mod_wsgi references. I'd this focusing on a nearby development server previously, however i can’t appear to obtain the variations. I know it’s a configuration factor because the code works within the dev atmosphere along with the debug server.

To start with, look at your Apache access and error logs and find out if you discover something fishy there:

How you can debug errors?

Once Apache begins, it'll create two log files, the access_log and also the error_log /installdir/apache2/logs directory. You are able to change these files to determine the exact error within the application.

from: http://wiki.bitnami.org/Components/Apache#How_to_debug_errors.3f