Question

Django development server is really nice, it shows the log of all POST/GET requests as well as other events in real time. Example of logs from Django dev server:

[04/Jul/2012 19:23:27] "GET /static/images/sprites/submit_url_hover.png HTTP/1.1" 200 7088
[04/Jul/2012 19:23:42] "POST /validate_link HTTP/1.1" 200 0
[04/Jul/2012 19:23:44] "POST /download_link HTTP/1.1" 200 0

It's very useful for debugging, figuring out the sources of 500 errors, etc. I've recently deployed my Django app on Apache and looking for logs analogous to that of Django Dev Server on Apache. There is obviously Apache error logs (snippet is below):

[Wed Jul 04 18:37:45 2012] [error] [u'microsoft', u'design', u'logos']
[Wed Jul 04 23:51:01 2012] [error] [client 140.180.6.212] File does not exist: /srv/my_project/app/portnoy/site_media/favicon.ico

But that's not what I want. My site has a simple link submission functionality which works locally (on Django dev server), but is not working on the actual site (running Apache). So seeing the Django dev server style logs on Apache will be really helpful. Any idea where can I look at? Thank in advance and happy 4th!

Était-ce utile?

La solution

Check access.log for the apache where you will see each request processed and response sent.

Also, if you have not tried yet, set DEBUG=True in your settings file so django will show you detail error, trace and other useful information.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top