Django+;Apache通过FastCGI:http错误代码被删除

Django+;Apache通过FastCGI:http错误代码被删除,django,apache,error-handling,Django,Apache,Error Handling,我通过FastCGI使用Django+Apache,在错误处理程序中有以下代码: def handler404(request): response = render_to_response('errors/404.html', locals(), context_instance=RequestContext(request)) response.status_code = 404 return response 我获取了无效的URL,请参见我的自定义404页面,但a

我通过FastCGI使用Django+Apache,在错误处理程序中有以下代码:

def handler404(request):
    response = render_to_response('errors/404.html', locals(), context_instance=RequestContext(request))
    response.status_code = 404
    return response
我获取了无效的URL,请参见我的自定义404页面,但apache访问日志中有类似的内容:

- - [29/May/2011:15:10:29 -0700] "GET /qqq HTTP/1.1" 200 1316 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17"
有没有可能用Apache中的404代码告诉搜索引擎爬虫,例如,这个页面不可用?
谢谢

另一个问题显示了如何实现您所追求的目标,尽管其中一个答案确实提到将status_code显式设置为404。这就是为什么我不投票作为一个重复关闭。我用render_to_字符串尝试了建议的解决方案,但仍然在apache的日志中看到code=200