POST的日志/ GET从Apache的Django应用程序的请求 [英] The logs of POST/GET requests from Django application on Apache

查看:284
本文介绍了POST的日志/ GET从Apache的Django应用程序的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Django开发服务器是非常好的,它显示了所有的POST的日志/实时获取请求以及其他活动。从Django的开发服务器日志的例子:

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

这对调试非常有用,计算出500错误的来源,等等我最近部署在Apache的我Django应用程序,并寻找日志类似于在Apache的Django开发服务器。显然有Apache的错误日志(片断如下):

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

但是,这不是我想要的。我的网站有一个简单的链接提交功能,这在当地工作(Django的开发服务器上),但不工作的实际网站(运行Apache)。所以,看到在Apache Django的开发服务器日志的风格将是非常有帮助的。任何想法我在哪里可以看到?预先感谢和快乐第四!

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!

推荐答案

检查的access.log为Apache,你会看到每个请求处理和响应发送出去。

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

另外,如果你还没有试过,设置 DEBUG = TRUE 您的设置文件,以便Django会告诉你详细的错误,跟踪和其他有用的信息。

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.

这篇关于POST的日志/ GET从Apache的Django应用程序的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆